/* INKLYDT editorial reader R12: one canonical manuscript shell. */
:root{
  --editorial-paper:#fbf9f5;
  --editorial-paper-deep:#f4f1e8;
  --editorial-ink:#294336;
  --editorial-muted:#6d796f;
  --editorial-rule:#d7dacf;
  --editorial-brass:#9b854e;
  --editorial-drawer:292px;
}

body[data-ecr-reader-build]{
  background:#f7f4ee!important;
  color:var(--editorial-ink)!important;
}
#inklydtCanonicalShell,
body[data-ecr-reader-build] header.system-bar{display:none!important}

/* First-paint/auth state stays full-width; no legacy rail reservation may flash. */
body[data-ecr-reader-build] .state-screen{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:100dvh!important;
  margin:0!important;
  padding:clamp(20px,4vw,44px)!important;
  background:#f7f4ee!important;
}
body[data-ecr-reader-build] .state-card{
  width:min(520px,100%)!important;
  padding:28px 30px!important;
  border:1px solid #cdd2c7!important;
  border-left:4px solid #315846!important;
  background:var(--editorial-paper)!important;
  box-shadow:0 24px 65px rgba(36,51,40,.13)!important;
}
body[data-ecr-reader-build] .state-kicker{color:#7d6f48!important}
body[data-ecr-reader-build] .state-card h1{color:var(--editorial-ink)!important}
body[data-ecr-reader-build] .state-card p{color:#657267!important}
body[data-ecr-reader-build]:has(#loadingScreen:not(.hidden)) #atmosWorld,
body[data-ecr-reader-build]:has(#loadingScreen:not(.hidden)) #ecrReaderPhaseWorld,
body[data-ecr-reader-build]:has(#blockedScreen:not(.hidden)) #atmosWorld,
body[data-ecr-reader-build]:has(#blockedScreen:not(.hidden)) #ecrReaderPhaseWorld{display:none!important}

#editorialReaderBar{
  position:sticky;
  top:0;
  z-index:13000;
  height:58px;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:0 22px;
  background:rgba(251,249,245,.98);
  border-bottom:1px solid #e0e1d7;
  color:var(--editorial-ink);
  backdrop-filter:blur(10px);
}
#editorialReaderBar #editorialMenu{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 11px;
  border:1px solid #cfd4c8;
  border-radius:7px;
  background:transparent;
  color:var(--editorial-ink);
  font:600 12px/1 system-ui,sans-serif;
  cursor:pointer;
}
#editorialReaderBar #editorialMenu:hover{background:#f1efe7}
#editorialReaderBar #editorialMenu:focus-visible{outline:2px solid var(--editorial-brass);outline-offset:2px}
#editorialReaderBar .editorial-title{
  font:18px/1 Georgia,"Times New Roman",serif;
  color:var(--editorial-ink);
  text-decoration:none;
}
#editorialActions{display:flex;gap:7px;align-items:center}
#editorialActions #ix-chat-launch{position:static!important;margin:0!important;transform:none!important}

/* Canonical reading-workspace drawer. Legacy Greyhart presentation is not used here. */
body[data-ecr-reader-build] .ecr-phase-sidebar{
  position:fixed!important;
  left:0!important;
  top:58px!important;
  bottom:0!important;
  z-index:12990!important;
  box-sizing:border-box!important;
  width:min(var(--editorial-drawer),88vw)!important;
  padding:0 14px 18px!important;
  overflow:auto!important;
  transform:translate3d(-102%,0,0)!important;
  visibility:hidden!important;
  pointer-events:none!important;
  background:var(--editorial-paper)!important;
  color:var(--editorial-ink)!important;
  border:0!important;
  border-right:1px solid var(--editorial-rule)!important;
  box-shadow:none!important;
  transition:transform .19s ease,visibility 0s linear .19s,box-shadow .19s ease!important;
}
body[data-ecr-reader-build].editorial-menu-open:not(.chapters-open) .ecr-phase-sidebar{
  transform:translate3d(0,0,0)!important;
  visibility:visible!important;
  pointer-events:auto!important;
  box-shadow:14px 0 44px rgba(31,48,36,.16)!important;
  transition-delay:0s!important;
}
body[data-ecr-reader-build].chapters-open .ecr-phase-sidebar{
  transform:translate3d(-102%,0,0)!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
body[data-ecr-reader-build] .ecr-phase-sidebar::before,
body[data-ecr-reader-build] .ecr-phase-sidebar::after{display:none!important}
body[data-ecr-reader-build] .ecr-phase-brand,
body[data-ecr-reader-build] .ecr-phase-nav-label,
body[data-ecr-reader-build] .ecr-phase-reader-record,
body[data-ecr-reader-build] .ecr-phase-stage-readout,
body[data-ecr-reader-build] .ecr-phase-botanical,
body[data-ecr-reader-build] .ecr-phase-motto,
body[data-ecr-reader-build] .ecr-phase-nav-rule{display:none!important}

.inklydt-editorial-drawer-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin:0 -14px 10px;
  padding:17px 16px 14px;
  border-bottom:1px solid var(--editorial-rule);
  background:rgba(251,249,245,.98);
  backdrop-filter:blur(8px);
}
.inklydt-editorial-drawer-head span{
  display:block;
  color:#877851;
  font:700 9px/1.3 system-ui,sans-serif;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.inklydt-editorial-drawer-head strong{
  display:block;
  margin-top:4px;
  color:var(--editorial-ink);
  font:400 20px/1.15 Georgia,"Times New Roman",serif;
}
.inklydt-editorial-drawer-close{
  flex:0 0 auto;
  min-width:58px;
  height:34px;
  padding:0 10px;
  border:1px solid #c8cec2;
  border-radius:7px;
  background:transparent;
  color:var(--editorial-ink);
  font:600 11px/1 system-ui,sans-serif;
  cursor:pointer;
}
.inklydt-editorial-drawer-close:hover{background:#f0eee6}
.inklydt-editorial-drawer-close:focus-visible{outline:2px solid var(--editorial-brass);outline-offset:2px}

body[data-ecr-reader-build] .ecr-phase-nav{
  display:grid!important;
  gap:3px!important;
  margin:0!important;
  padding:0!important;
}
body[data-ecr-reader-build] .ecr-phase-nav button{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:42px!important;
  display:grid!important;
  grid-template-columns:25px minmax(0,1fr)!important;
  align-items:center!important;
  gap:10px!important;
  padding:8px 10px!important;
  border:1px solid transparent!important;
  border-radius:7px!important;
  background:transparent!important;
  color:#4c6153!important;
  text-align:left!important;
  font:600 12px/1.25 system-ui,sans-serif!important;
  cursor:pointer!important;
}
body[data-ecr-reader-build] .ecr-phase-nav button b{
  color:#8a7a4c!important;
  font:400 15px/1 Georgia,serif!important;
  text-align:center!important;
}
body[data-ecr-reader-build] .ecr-phase-nav button span{display:block!important}
body[data-ecr-reader-build] .ecr-phase-nav button:hover{background:#f1efe7!important;border-color:#e3e3d9!important}
body[data-ecr-reader-build] .ecr-phase-nav button.is-active{
  background:#ecefe5!important;
  border-color:#d5dbce!important;
  color:#294b3a!important;
  box-shadow:inset 3px 0 #9b854e!important;
}
body[data-ecr-reader-build] .ecr-phase-nav button:focus-visible{outline:2px solid var(--editorial-brass)!important;outline-offset:2px!important}

#editorialMenuScrim{
  position:fixed;
  inset:58px 0 0;
  z-index:12980;
  display:block;
  border:0;
  padding:0;
  background:rgba(31,43,34,.22);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .16s ease,visibility 0s linear .16s;
}
body.editorial-menu-open:not(.chapters-open) #editorialMenuScrim{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition-delay:0s;
}
body.editorial-menu-open{overflow:hidden}

body[data-ecr-reader-build] #app{padding-left:0!important;padding-top:0!important}
body[data-ecr-reader-build] .reader-shell{
  margin:0 auto!important;
  width:min(900px,calc(100% - 48px))!important;
  padding:42px 0 100px!important;
  background:transparent!important;
}
body[data-ecr-reader-build] .reader-shell::before{display:none!important}
body[data-ecr-reader-build] .reading-chamber{
  width:100%!important;
  max-width:800px!important;
  margin:24px auto!important;
  background:var(--editorial-paper)!important;
  border:0!important;
  box-shadow:0 20px 40px -15px rgba(40,48,40,.07)!important;
  border-radius:3px!important;
}
body[data-ecr-reader-build] .manuscript-body{
  max-width:66ch!important;
  margin:0 auto!important;
  padding:38px 40px!important;
  font:18px/1.8 Georgia,"Times New Roman",serif!important;
  color:#263a31!important;
}
body[data-ecr-reader-build] .reader-heading{display:block!important;text-align:center!important;margin:0 auto!important}
body[data-ecr-reader-build] .reader-heading h1,
body[data-ecr-reader-build] #sectionTitle{
  max-width:700px!important;
  margin:0 auto 14px!important;
  color:var(--editorial-ink)!important;
  font:400 clamp(30px,4vw,44px)/1.15 Georgia,"Times New Roman",serif!important;
  letter-spacing:-.025em!important;
}
body[data-ecr-reader-build] .reader-heading-actions{justify-content:center!important;margin-top:12px!important}
body[data-ecr-reader-build] .reader-controls{
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:min(620px,calc(100vw - 24px))!important;
  background:var(--editorial-paper)!important;
  border:1px solid #d6dace!important;
  box-shadow:0 6px 25px rgba(39,59,36,.07)!important;
  border-radius:10px!important;
}
body[data-ecr-reader-build] .reader-controls button{
  background:transparent!important;
  color:#34513e!important;
  border:0!important;
  font:11px system-ui,sans-serif!important;
}

body[data-ecr-reader-build] #selectionComposer:not(.editor-open) header,
body[data-ecr-reader-build] #selectionComposer:not(.editor-open) .composer-pane,
body[data-ecr-reader-build] #selectionComposer:not(.editor-open) .composer-status{display:none!important}
body[data-ecr-reader-build] #selectionComposer:not(.editor-open):not(.hidden){width:320px!important;max-width:calc(100vw - 24px)!important;border-radius:12px!important;min-height:0!important}
body[data-ecr-reader-build] #selectionComposer:not(.editor-open) .composer-tabs{margin:4px!important;background:var(--editorial-paper)!important}
body[data-ecr-reader-build] #selectionComposer.editor-open .composer-tabs{margin-top:10px!important}
body[data-ecr-reader-build] #selectionComposer.editor-open header{position:relative!important}

body[data-ecr-reader-build] #editorialReadingControls{
  min-height:48px!important;
  padding:8px!important;
  background:var(--editorial-paper)!important;
  color:var(--editorial-ink)!important;
  border:1px solid #cdd3c7!important;
  box-shadow:0 4px 18px rgba(38,59,35,.07)!important;
  opacity:1!important;
}
body[data-ecr-reader-build] #editorialReadingControls button{
  min-height:36px!important;
  border:1px solid #d6dbce!important;
  border-radius:7px!important;
  background:#f3f1e8!important;
  color:var(--editorial-ink)!important;
  -webkit-text-fill-color:var(--editorial-ink)!important;
  opacity:1!important;
  font:600 12px/1.3 system-ui,sans-serif!important;
  letter-spacing:0!important;
  text-shadow:none!important;
}
body[data-ecr-reader-build] #editorialReadingControls button:disabled{color:#6c766a!important;-webkit-text-fill-color:#6c766a!important;background:transparent!important;opacity:.65!important}
body[data-ecr-reader-build] #editorialReadingControls button:focus-visible{outline:2px solid var(--editorial-brass)!important;outline-offset:2px!important}

@media(max-width:920px){
  #editorialReaderBar{padding:0 12px;gap:8px}
  #editorialReaderBar .editorial-title{font-size:15px}
  #editorialReaderBar #editorialMenu span{display:none}
  body[data-ecr-reader-build] .reader-shell{width:calc(100% - 24px)!important;padding-top:26px!important}
  body[data-ecr-reader-build] .manuscript-body{padding:28px 22px!important;font-size:17px!important}
  body[data-ecr-reader-build] .ecr-phase-sidebar{width:min(320px,88vw)!important}
}

@media(prefers-reduced-motion:reduce){
  body[data-ecr-reader-build] .ecr-phase-sidebar,
  #editorialMenuScrim{transition:none!important}
}
