.project-shell .brand,.project-shell .breadcrumbs a {text-decoration:none}
.project-shell .breadcrumbs a {color:var(--muted)}
.project-shell .library-heading {margin-bottom:1.4rem}
.project-shell #project-title {overflow-wrap:anywhere}
.project-top-actions,.reader-actions {display:flex;gap:.4rem;align-items:center}
.project-tools,.overview-controls {display:flex;align-items:center;flex-wrap:wrap;gap:.45rem}
.project-tools {margin:.85rem 0 1.2rem}
.project-tools>button,.project-tools summary,.overview-controls>button,.overview-controls select {border:1px solid var(--control-line);border-radius:.45rem;color:var(--ink);background:var(--paper);padding:.48rem .72rem;font:.85rem/1.35 var(--sans);min-height:2.35rem}
.project-tools>button:hover,.project-tools summary:hover,.overview-controls>button:hover {background:var(--pale)}
.overview-controls>button[aria-pressed=true] {color:var(--on-primary,white);background:var(--primary);border-color:var(--primary)}
.overview-controls label,.overview-controls select {margin:0}
.overview-controls label {font-size:.85rem;color:var(--muted)}
.project-tools .menu {left:0;right:auto;min-width:12rem}
.project-section {margin:1.25rem 0 1.7rem}
.project-section h2 {font:600 .8rem/1.2 var(--sans);text-transform:uppercase;letter-spacing:.075em;color:var(--muted);margin:.8rem 0}
.project-section .menu {min-width:10.8rem}
.chapter-heading {font:400 1.65rem/1.2 var(--display);color:var(--ink);margin:0;padding:.8rem 1rem .45rem;border-bottom:1px solid var(--line)}
.project-section .row-actions {align-items:center;flex-shrink:0}
.project-section .row-actions>button {width:2rem}
.project-section button:disabled {opacity:.4}
.move-up .ph {transform:rotate(180deg)}
.project-shell .open-row {min-height:3.65rem}
.project-shell .row-copy {flex:1;min-width:0}
.project-shell .row-copy>* {white-space:normal;overflow-wrap:anywhere}
.project-shell .synopsis {display:block;font:1.02rem/1.43 var(--prose);color:var(--text);margin:.25rem 0 .05rem}
.project-shell .section-tags {margin-top:.15rem;color:var(--primary)}
.project-shell #project-intent {border-left:3px solid var(--accent);background:var(--pale);padding:.8rem 1rem;color:var(--ink)}
#project-overview {padding:1rem clamp(.75rem,2.5vw,1.35rem);background:var(--pale);border-radius:.6rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
#project-progress {display:grid;gap:.28rem;align-content:center}
#project-progress strong {font:600 .98rem var(--sans);color:var(--ink)}
#project-progress small {color:var(--muted)}
#project-progress progress {width:min(100%,15rem);height:.4rem;accent-color:var(--primary)}
.card-view .library-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:.75rem;border:0;background:transparent;overflow:visible}
.card-view .section-row {border:1px solid var(--line);border-top:3px solid var(--accent);background:var(--paper);border-radius:.4rem;display:flex;align-items:stretch;flex-direction:column;min-width:0}
.card-view .section-row .open-row {align-items:flex-start;flex:1;padding:.9rem;min-height:5.2rem}
.card-view .section-row .row-actions {align-self:flex-end;padding:0 .45rem .3rem}
.card-view .chapter-heading {grid-column:1/-1;padding:.55rem .05rem;border:0}
.field-pair {display:grid;grid-template-columns:1fr 1fr;gap:.8rem}
.field-pair>* {min-width:0}
.field-pair select,.field-pair input {margin-top:.3rem;width:100%;min-width:0}
.reference-fields,.archived-feedback {margin-top:.9rem;color:var(--ink)}
.reference-fields>summary,.archived-feedback>summary {cursor:pointer}
.feedback-record {border-bottom:1px solid var(--line);padding:.6rem 0}
.feedback-record p,.feedback-record blockquote {margin:.25rem 0}
.feedback-record blockquote {padding-left:.65rem;border-left:2px solid var(--accent)}
#import-preview {max-height:32vh;overflow:auto}
#import-preview li {padding:.2rem 0;overflow-wrap:anywhere}
#read-dialog {width:min(52rem,calc(100vw - 1.5rem));background:var(--manuscript-paper,var(--paper));color:var(--manuscript-ink,var(--ink))}
#read-dialog .dialog-head {align-items:flex-start}
#read-title {overflow-wrap:anywhere}
#read-body {max-width:var(--reading-measure,65ch);margin:auto;padding:.6rem clamp(.25rem,3vw,1.8rem) 1rem;font-family:var(--writing-font,var(--prose));font-size:var(--writing-size,1.15rem);line-height:var(--writing-leading,1.65);overflow-wrap:break-word}
#read-body h2,#read-body h3,#read-body h4,#read-body h5,#read-body h6 {font-family:var(--display);font-weight:400;color:inherit;text-wrap:balance;line-height:1.13}
#read-body h2 {font-size:2.5rem;margin:.35rem 0 1.15rem}
#read-body .part-name,#read-author {font:.85rem var(--sans);margin:1.15rem 0 .3rem;color:inherit}
#read-body .manuscript-section+.manuscript-section {margin-top:2.4rem;border-top:1px solid var(--line);padding-top:1rem}
#read-body blockquote {border-left:3px solid var(--accent);margin:.9rem 0;padding-left:1rem;font-style:italic}
#read-body img {display:block;max-width:100%;max-height:70vh;object-fit:contain;height:auto;margin:.7rem auto}
#read-body mark {color:#24213e;background:#ffe797}
#read-body .footnotes {font-size:.88em;border-top:1px solid var(--line);margin-top:1.5rem}
#read-body .missing-image {font-style:italic}
@media(max-width:740px){.project-shell .topbar{background:var(--side) var(--prism-toolbar)}.project-shell .breadcrumbs button,.project-shell .breadcrumbs>span[aria-hidden]{display:inline-flex}.project-shell .sidebar{display:none}.project-shell .library-heading{align-items:flex-start}.project-shell .library-new{white-space:nowrap}.project-section .file-icon{display:none}.project-section .open-row{padding-inline:.55rem}.project-section .row-actions{gap:0}.project-section .row-actions>button {width:1.8rem}.project-tools .dropdown:last-child .menu {left:auto;right:0}}
@media(max-width:420px){.field-pair{grid-template-columns:1fr;gap:0}.reader-actions {flex-direction:column-reverse;align-items:flex-end}}
@media print {
  @page {margin:18mm}
  html,body {display:block!important;overflow:visible!important;height:auto!important;background:white!important;color:black!important}
  body>*:not(#read-dialog) {display:none!important}
  #read-dialog[open] {display:block!important;position:static!important;inset:auto!important;max-height:none!important;height:auto!important;overflow:visible!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;box-shadow:none!important;background:white!important;color:black!important;border:0!important}
  #read-dialog::backdrop {display:none!important}
  #read-dialog .reader-actions {display:none!important}
  #read-title {font:32pt Georgia,serif}
  #read-body {max-width:none;font:12pt/1.5 Georgia,serif;padding:0}
  #read-body h2,#read-body h3 {break-after:avoid;color:black}
  #read-body .manuscript-section+.manuscript-section {break-before:page;border:0;padding:0;margin:0}
  #read-body img {break-inside:avoid;max-height:72vh}
}

.style-actions,.style-accent {display:flex;align-items:center;flex-wrap:wrap;gap:.6rem;margin:.45rem 0 .65rem}
.style-actions .quiet-button {font-size:.875rem}
.style-accent .check-label {margin:0}
#style-accent {width:2.8rem;height:2.2rem;padding:.15rem;border:1px solid var(--control-line);border-radius:.3rem;cursor:pointer}
#style-accent:disabled {opacity:.45}
.style-preview {margin:.8rem 0 0;padding:.9rem 1rem;border:1px solid var(--line);border-radius:.4rem;background:#fff;color:#24213e;overflow-wrap:anywhere}
.style-preview strong {display:block;font:600 1.45rem/1.2 var(--print-heading,serif);border-bottom:2px solid var(--print-accent,transparent);padding:0 0 .15rem}
.style-preview p {font-family:var(--print-font,serif);font-size:var(--print-size,12pt);line-height:var(--print-leading,1.55);margin:.42rem 0}
@media print {
  #read-dialog[open] #read-title,#read-dialog[open] #read-body h2,#read-dialog[open] #read-body h3,#read-dialog[open] #read-body h4 {font-family:var(--print-heading,Georgia,serif)}
  #read-dialog[open] #read-body {font-family:var(--print-font,Georgia,serif);font-size:var(--print-size,12pt);line-height:var(--print-leading,1.55)}
  #read-dialog[open] #read-body h2 {border-bottom:2px solid var(--print-accent,transparent);padding-bottom:.15em}
}

.project-tools > #book-thought { display:inline-flex; align-items:center; min-height:44px; padding:.45rem .75rem; color:var(--primary); border:1px solid var(--control-line); border-radius:.45rem; font-size:.87rem; font-weight:600; text-decoration:none; }
.project-shell .app-nav { margin-bottom:.7rem; }
.project-shell .app-tabs { margin:0; }
@media(max-width:760px) {
  .project-shell { flex-direction:column; }
  .project-shell > .sidebar { display:none; }
  .project-shell > .workspace { flex:1 1 auto; min-height:0; }
  .project-shell > .app-tabs { flex:0 0 auto; }
}
