/* My Shelf — full-viewport Book reader (BOOK-01)
   Book is a presentation of the canonical Collection and Collection-item records. */
.shelf-book-reader{
  --shelf-book-colour:#486B74;
  --shelf-paper:#f8f5ec;
  position:fixed;
  inset:0;
  z-index:2000;
  isolation:isolate;
  color:#edf1ed;
  font-family:inherit;
}
.shelf-book-backdrop{
  position:absolute;
  inset:0;
  background:radial-gradient(ellipse at 50% 36%,#263b39 0%,#101a1a 75%,#080f10 100%);
  cursor:default;
}
.shelf-book-shell{
  position:relative;
  z-index:1;
  box-sizing:border-box;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  width:100%;
  height:100%;
  height:100dvh;
  overflow:hidden;
  padding:13px clamp(12px,2.6vw,44px) 12px;
}
.shelf-book-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  min-height:56px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(231,241,234,.13);
}
.shelf-book-heading{
  min-width:0;
  display:flex;
  align-items:center;
  gap:11px;
}
.shelf-book-emblem{
  width:33px;
  height:38px;
  display:grid;
  place-items:center;
  flex:none;
  border-radius:5px 3px 3px 5px;
  border-left:4px solid #d3ddd6;
  background:var(--shelf-book-colour);
  box-shadow:2px 3px 8px #0005;
  color:#f8f4e9;
}
.shelf-book-heading div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.shelf-book-heading small{
  color:#9badab;
  letter-spacing:.12em;
  font-size:9px;
  font-weight:800;
}
.shelf-book-heading strong{
  font-size:clamp(14px,1.35vw,19px);
  color:#f4f5f0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.shelf-book-actions{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.shelf-book-actions button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:36px;
  padding:0 12px;
  border:1px solid rgba(231,241,234,.21);
  border-radius:8px;
  background:rgba(255,255,255,.06);
  color:#f2f4f0;
  font:inherit;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.shelf-book-actions button:hover,
.shelf-book-actions button:focus-visible{
  background:rgba(255,255,255,.15);
}
.shelf-book-actions .shelf-book-close{
  background:#365457;
  border-color:#5d7779;
}
.shelf-book-stage{
  box-sizing:border-box;
  min-width:0;
  min-height:0;
  display:grid;
  place-items:center;
  padding:17px clamp(32px,3vw,52px) 9px;
  perspective:2400px;
}
.shelf-book-binding{
  position:relative;
  width:min(1240px,100%);
  height:min(820px,100%);
  min-height:0;
  filter:drop-shadow(0 15px 30px rgba(0,0,0,.42));
}
.shelf-book-binding::before{
  content:'';
  position:absolute;
  inset:-8px -10px -10px;
  border-radius:11px;
  border:1px solid rgba(0,0,0,.52);
  background:var(--shelf-book-colour);
  box-shadow:0 15px 30px #0006,0 3px 3px #0004;
}
.shelf-book-spread{
  position:relative;
  display:flex;
  width:100%;
  height:100%;
  background:var(--shelf-paper);
  transform-style:preserve-3d;
  perspective:4600px;
}
.shelf-book-spread::after{
  content:'';
  position:absolute;
  z-index:11;
  top:0;
  bottom:0;
  left:calc(50% - 8px);
  width:16px;
  background:linear-gradient(90deg,transparent,rgba(23,28,24,.22) 50%,transparent);
  pointer-events:none;
}
.shelf-book-leaf{
  position:relative;
  box-sizing:border-box;
  flex:0 0 50%;
  width:50%;
  min-width:0;
  height:100%;
  display:flex;
  flex-direction:column;
  padding:clamp(17px,2.2vw,34px) clamp(18px,3vw,48px) 18px;
  background:linear-gradient(100deg,#e7e1d4 0%,#faf7f0 5%,#faf7f0 94%,#e8e2d6 100%);
  border:1px solid #d5cec0;
  color:#2c3530;
  overflow:hidden;
}
.shelf-book-leaf:first-child{
  box-shadow:inset -13px 0 18px -16px rgba(0,0,0,.7);
}
.shelf-book-leaf:nth-child(2){
  box-shadow:inset 13px 0 18px -16px rgba(0,0,0,.68);
}
.shelf-book-leaf-main{
  display:flex;
  flex:1;
  min-height:0;
  flex-direction:column;
  overflow:hidden;
  padding-top:16px;
}
.shelf-book-leaf-number{
  flex:none;
  min-height:18px;
  padding-top:10px;
  margin-top:12px;
  border-top:1px solid #e3ded3;
  text-align:center;
  font:11px Georgia,serif;
  color:#767f75;
}
.shelf-book-entry{
  display:flex;
  flex:1;
  flex-direction:column;
  min-height:0;
  min-width:0;
}
.shelf-book-entry-heading{
  flex:none;
  margin-bottom:17px;
}
.shelf-book-entry-date{
  display:block;
  font-size:10px;
  font-weight:700;
  line-height:1.4;
  letter-spacing:.11em;
  text-transform:uppercase;
  color:#6d837a;
}
.shelf-book-entry-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:9px;
}
.shelf-book-entry h2{
  flex:1;
  min-width:0;
  overflow-wrap:anywhere;
  margin:10px 0 0;
  color:#233e3b;
  font:700 clamp(17px,1.8vw,26px)/1.22 Georgia,serif;
}
.shelf-book-edit-link{
  flex:none;
  padding:5px 8px;
  border:1px solid #c7cfc6;
  border-radius:6px;
  background:#e9efe7;
  color:#335c51;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
}
.shelf-book-prose{
  box-sizing:border-box;
  flex:1;
  min-height:0;
  overflow:hidden;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:normal;
  color:#333d36;
  font:clamp(12px,1.08vw,15px)/1.67 Georgia,serif;
  letter-spacing:.008em;
}
.shelf-book-contents{
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.shelf-book-overline{
  margin:4px 0 4px;
  color:#789086;
  text-transform:uppercase;
  font:700 10px Georgia,serif;
  letter-spacing:.11em;
}
.shelf-book-contents h2{
  margin:8px 0 22px;
  font:700 clamp(24px,2.8vw,39px)/1.2 Georgia,serif;
  color:#263d36;
}
.shelf-book-contents-list{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:2px;
  overflow:hidden;
}
.shelf-book-contents-list>button{
  display:flex;
  align-items:flex-start;
  gap:10px;
  width:100%;
  min-width:0;
  padding:9px 5px;
  border:0;
  border-bottom:1px dotted #c7c9be;
  background:transparent;
  color:#37554b;
  text-align:left;
  font:inherit;
  cursor:pointer;
}
.shelf-book-contents-list>button:hover,
.shelf-book-contents-list>button:focus-visible{
  background:rgba(65,104,88,.09);
}
.shelf-book-contents-number{
  flex:0 0 19px;
  color:#9c9889;
  font:12px Georgia,serif;
}
.shelf-book-contents-copy{
  display:flex;
  flex:1;
  min-width:0;
  flex-direction:column;
  gap:3px;
}
.shelf-book-contents-copy strong{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  overflow-wrap:anywhere;
  font:600 clamp(11px,.96vw,13px)/1.25 Georgia,serif;
}
.shelf-book-contents-copy small{
  font:10px Georgia,serif;
  color:#858a80;
}
.shelf-book-contents-page{
  font:11px Georgia,serif;
  color:#667e72;
}
.shelf-book-contents-empty{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:13px;
  max-width:360px;
  padding:25px 0;
  font:14px/1.6 Georgia,serif;
}
.shelf-book-contents-empty strong{font-size:18px}
.shelf-book-contents-empty p{margin:0;color:#66756b}
.shelf-book-contents-empty button{
  padding:10px 13px;
  border:1px solid #65857a;
  border-radius:7px;
  background:#456f64;
  color:#fff;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.shelf-book-blank{
  flex:1;
  display:grid;
  place-items:center;
}
.shelf-book-blank-mark{
  font:38px Georgia,serif;
  opacity:.2;
  color:#6c897a;
}
.shelf-book-edge{
  position:absolute;
  z-index:30;
  top:50%;
  transform:translateY(-50%);
  width:41px;
  height:74px;
  border:1px solid rgba(227,234,227,.27);
  background:rgba(8,19,19,.87);
  color:#eaf0e9;
  font:35px/1 Georgia,serif;
  cursor:pointer;
  display:grid;
  place-items:center;
  box-shadow:0 7px 19px #0006;
}
.shelf-book-edge.is-prev{left:-42px;border-radius:9px 0 0 9px}
.shelf-book-edge.is-next{right:-42px;border-radius:0 9px 9px 0}
.shelf-book-edge:hover{background:var(--shelf-book-colour)}
.shelf-book-edge:disabled{cursor:default;opacity:.25}
.shelf-book-statusbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  min-height:27px;
  color:#a0b1ab;
  font-size:10px;
  line-height:1.4;
  letter-spacing:.025em;
}
.shelf-book-position{
  color:#e1eee5;
  font-weight:800;
  font-variant-numeric:tabular-nums;
}
/* The actual moving sheet has a front and back. It turns from the
   centre binding rather than sliding the entire spread sideways. */
.shelf-book-turn-sheet{
  position:absolute;
  z-index:20;
  top:0;
  left:50%;
  width:50%;
  height:100%;
  transform:rotateY(0deg);
  transform-origin:0 50%;
  transform-style:preserve-3d;
  pointer-events:none;
  will-change:transform;
}
.shelf-book-turn-sheet.is-backward{
  left:0;
  transform-origin:100% 50%;
}
/* The moving sheet is a curved surface of narrow, opaque paper strips.
   Each strip is a vertical slice of the SAME complete page, so line breaks
   and typography stay exactly aligned as the sheet bends in three dimensions. */
.shelf-book-curl-slice{
  position:absolute;
  inset:0;
  transform-style:preserve-3d;
  pointer-events:none;
  will-change:transform;
}
.shelf-book-curl-face{
  position:absolute;
  inset:0;
  overflow:hidden;
  pointer-events:none;
}
.shelf-book-curl-face.is-back{
  /* Pre-mirror ink so it reads normally after the physical page turns 180°. */
  transform:scaleX(-1);
  opacity:0;
}
.shelf-book-curl-face>.shelf-book-leaf{
  width:100%;
  height:100%;
  flex:0 0 100%;
  border-color:#e0dbce;
  background:linear-gradient(100deg,#ebe6db 0%,#faf7f0 4%,#faf7f0 95%,#e9e3d7 100%);
}
.shelf-book-curl-light{
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  opacity:0;
  background:linear-gradient(90deg,
    rgba(255,255,255,.32) 0%,
    rgba(255,255,255,.10) 26%,
    rgba(29,39,30,.13) 57%,
    rgba(25,31,24,.29) 84%,
    rgba(255,255,255,.2) 100%);
  mix-blend-mode:multiply;
}
.shelf-book-curl-under-shadow{
  position:absolute;
  z-index:16;
  top:0;
  bottom:0;
  width:50%;
  pointer-events:none;
  opacity:0;
  background:linear-gradient(90deg,transparent 20%,rgba(21,28,24,.08) 48%,rgba(16,22,19,.42) 96%);
  mix-blend-mode:multiply;
}
.shelf-book-curl-under-shadow.is-forward{left:0}
.shelf-book-curl-under-shadow.is-backward{left:50%;transform:scaleX(-1)}
.shelf-book-static-page{
  position:absolute;
  z-index:15;
  top:0;
  left:0;
  width:50%;
  height:100%;
  overflow:hidden;
  pointer-events:none;
}
.shelf-book-static-page.is-right{left:50%}
.shelf-book-static-page>.shelf-book-leaf{
  width:100%;
  height:100%;
  flex:0 0 100%;
}
.shelf-book-opening-cover{
  position:absolute;
  z-index:40;
  top:0;
  left:50%;
  width:50%;
  height:100%;
  border:1px solid #213532;
  border-left:9px solid #243c3c;
  border-radius:2px 11px 11px 2px;
  background:
    linear-gradient(90deg,rgba(0,0,0,.32),transparent 22%,rgba(255,255,255,.08) 80%,rgba(0,0,0,.19)),
    var(--shelf-book-colour);
  box-shadow:inset 0 0 0 6px rgba(225,232,216,.1),10px 15px 30px #0005;
  color:#f1ebd9;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:30px;
  backface-visibility:hidden;
  transform-origin:0 50%;
  pointer-events:none;
}
.shelf-book-cover-title{
  max-width:84%;
  color:#f6eee0;
  font:700 clamp(24px,3.2vw,48px)/1.3 Georgia,serif;
  text-align:center;
  overflow-wrap:anywhere;
}
.shelf-book-cover-decoration{font:50px Georgia,serif;opacity:.6}
.shelf-book-measure-leaf{z-index:-1}
.shelf-book-reader :focus-visible{
  outline:3px solid #82ded0;
  outline-offset:2px;
}
/* Tablets and phones read one printed page at a time. */
@media(max-width:1024px){
  .shelf-book-shell{padding:8px 7px 5px}
  .shelf-book-toolbar{min-height:52px;padding:0 6px 8px}
  .shelf-book-emblem{width:28px;height:34px}
  .shelf-book-actions{gap:4px}
  .shelf-book-actions button{padding:0 9px;min-height:34px}
  .shelf-book-actions button span{display:none}
  .shelf-book-stage{padding:10px 24px 9px}
  .shelf-book-binding{width:100%;height:100%}
  .shelf-book-binding::before{inset:-5px -5px -6px}
  .shelf-book-spread::after{display:none}
  .shelf-book-leaf{flex-basis:100%;width:100%;padding:20px clamp(19px,5vw,32px) 15px}
  .shelf-book-leaf-main{padding-top:12px}
  .shelf-book-edge{width:28px;height:62px;font-size:26px}
  .shelf-book-edge.is-prev{left:-29px}
  .shelf-book-edge.is-next{right:-29px}
  .shelf-book-turn-sheet,
  .shelf-book-turn-sheet.is-backward{
    left:0;width:100%;
  }
  .shelf-book-turn-sheet.is-single{width:100%}
  .shelf-book-curl-under-shadow{width:100%;left:0!important}
  .shelf-book-opening-cover{left:0;width:100%;transform-origin:0 50%}
  .shelf-book-prose{font-size:clamp(12px,3.1vw,15px)}
  .shelf-book-statusbar span:last-child{display:none}
}
@media(max-width:390px){
  .shelf-book-actions button{padding:0 7px}
  .shelf-book-heading strong{max-width:38vw;font-size:12px}
  .shelf-book-leaf{padding:14px 16px 12px}
  .shelf-book-entry h2{font-size:18px}
  .shelf-book-entry-heading{margin-bottom:11px}
}
@media(prefers-reduced-motion:reduce){
  .shelf-book-reader *,
  .shelf-book-reader *::before,
  .shelf-book-reader *::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    transition-duration:.01ms!important;
  }
}
/* The Standard Editor's writing area is enlarged ONLY for a shelf Book entry.
   Other entity SE-PUPs retain their original layout and Description fields. */
.book-day-draft-editor.book-day-book-entry{
  width:min(760px,calc(100vw - 28px));
  max-height:calc(100dvh - 36px);
  overflow-y:auto;
}
.book-day-draft-editor.book-day-book-entry .book-day-draft-fields{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:15px;
  padding:14px 20px 20px;
}
.book-day-draft-editor.book-day-book-entry .book-entry-body-row{
  align-items:start;
}
.book-day-draft-editor.book-day-book-entry .book-entry-body-row > div:last-child{
  min-width:0;
  width:100%;
}
.book-day-draft-editor.book-day-book-entry .book-entry-body-label{
  display:block;
  margin:0 0 8px;
  color:var(--text);
  font-size:12px;
  font-weight:800;
}
.book-day-draft-editor.book-day-book-entry textarea.book-entry-body-input{
  display:block;
  box-sizing:border-box;
  width:100%;
  min-height:230px;
  height:clamp(230px,45dvh,530px);
  max-height:calc(100dvh - 250px);
  padding:13px 15px;
  resize:vertical;
  line-height:1.65;
  font-size:14px;
  letter-spacing:.005em;
}
@media(max-width:540px){
  .book-day-draft-editor.book-day-book-entry .book-day-draft-fields{
    padding:12px 13px 16px;
    gap:12px;
  }
  .book-day-draft-editor.book-day-book-entry textarea.book-entry-body-input{
    min-height:190px;
    height:40dvh;
    font-size:13px;
  }
}


/* Inline review of Holding Journal entries only; paper layout is unchanged. */
.shelf-book-inline-editor{height:100%;display:flex;flex-direction:column;gap:9px;min-height:0;color:#253431}
.shelf-book-inline-editor label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:700;min-height:0;flex:1}
.shelf-book-inline-editor textarea{width:100%;flex:1;min-height:160px;box-sizing:border-box;resize:none;border:1px solid #90a6a0;border-radius:5px;padding:10px;background:#faf9ee;color:#202a27;font:13px/1.45 Georgia,serif}
.shelf-book-inline-actions{display:flex;justify-content:flex-end;gap:9px}
.shelf-book-inline-actions button{padding:7px 11px;border:1px solid #90a6a0;border-radius:5px;background:#e9e8d9;color:#202a27;cursor:pointer}
.shelf-book-inline-actions button:last-child{background:#286e69;color:white}
.shelf-book-inline-feedback{font-size:11px;margin:0}

/* Tighter typesetting for all Book pages: more useful text per physical leaf. */
.shelf-book-leaf{padding:clamp(14px,1.65vw,24px) clamp(15px,2.2vw,34px) 11px}
.shelf-book-leaf-main{padding-top:8px}
.shelf-book-entry-heading{margin-bottom:9px}
.shelf-book-entry h2{margin:4px 0 0;font-size:clamp(16px,1.45vw,22px);line-height:1.2}
.shelf-book-entry-date{font-size:9px;letter-spacing:.06em}
.shelf-book-prose{font:clamp(12px,.98vw,14px)/1.44 Georgia,serif;letter-spacing:0}
.shelf-book-leaf-number{min-height:15px;padding-top:5px;margin-top:6px;font-size:10px}
.shelf-book-contents h2{margin:5px 0 12px}
.shelf-book-contents-list>button{padding:5px 4px}
@media(max-width:1024px){.shelf-book-leaf{padding:15px 19px 10px}.shelf-book-prose{font-size:13px;line-height:1.48}}

/* Accessible journal reading typography: crisp sans-serif and clear contrast. */
.shelf-book-entry h2{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-weight:750;font-size:clamp(18px,1.55vw,23px);line-height:1.3;letter-spacing:-.015em;color:#17352f}
.shelf-book-entry-date{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-weight:700;font-size:10px;letter-spacing:.04em;color:#4b655d}
.shelf-book-prose{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:clamp(14px,1.05vw,16px);line-height:1.52;font-weight:400;letter-spacing:0;color:#222d29}
.shelf-book-contents-copy strong,.shelf-book-contents-copy small{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
@media(max-width:1024px){.shelf-book-prose{font-size:14px;line-height:1.5}}

/* Dock the original physical Book across the dashboard's left and centre
   panels, leaving the existing right context rail as journal navigation. */
.shelf-book-reader.shelf-book-reader-dashboard{position:fixed;inset:auto;z-index:1100}
.shelf-book-reader-dashboard .shelf-book-shell{height:100%;padding:9px 12px 9px}
.shelf-book-reader-dashboard .shelf-book-stage{padding:10px 30px 8px;min-height:0}
.shelf-book-reader-dashboard .shelf-book-binding{width:min(100%,1100px);height:100%}
.shelf-book-reader-dashboard .shelf-book-toolbar{min-height:46px;padding-bottom:5px}
.shelf-book-reader-dashboard .shelf-book-statusbar{min-height:18px}
body.book-reader-in-dashboard #bookQuickRail{position:relative;z-index:1101}
body.book-reader-in-dashboard #bookQuickRail > :not(#shelfBookQuickNav){display:none!important}
.shelf-book-quick-nav{position:sticky;top:0;display:flex;flex-direction:column;min-height:0;padding:13px 12px;color:#e8f0ec;background:#122326;border-left:1px solid #355257;overflow:hidden;box-sizing:border-box}
.shelf-book-nav-header{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;margin-bottom:15px}
.shelf-book-nav-header button{border:0;background:transparent;color:inherit;font-size:20px;cursor:pointer}
.shelf-book-nav-search{display:flex;gap:5px;margin-bottom:12px}
.shelf-book-nav-search input{min-width:0;width:100%;background:#1f3437;color:#fff;border:1px solid #486368;border-radius:5px;padding:8px;font-size:12px}
.shelf-book-nav-search button,.shelf-book-nav-bottom button{border:1px solid #486368;border-radius:5px;padding:7px;color:#f1f5f2;background:#29464a;cursor:pointer;font-size:11px}
.shelf-book-nav-count{font-size:11px;color:#9eb6b2;margin-bottom:8px}
.shelf-book-nav-list{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:3px}
.shelf-book-nav-list button{display:flex;flex-direction:column;gap:3px;text-align:left;cursor:pointer;border:1px solid transparent;border-radius:5px;color:#e8f0ed;background:transparent;padding:9px 8px}
.shelf-book-nav-list button:hover,.shelf-book-nav-list button.is-current{background:#244144;border-color:#426568}
.shelf-book-nav-list strong{font-size:12px;font-weight:650;line-height:1.3}
.shelf-book-nav-list small{color:#9bb3ae;font-size:10px}
.shelf-book-nav-bottom{display:flex;gap:6px;padding-top:12px}
.shelf-book-nav-bottom button{flex:1}
.shelf-book-nav-bottom button:disabled{opacity:.35;cursor:default}
@media(max-width:1050px){.shelf-book-reader-dashboard .shelf-book-stage{padding:8px 28px}}

.shelf-book-nav-reset{display:block;width:100%;text-align:left;border:0;background:transparent;color:#8bddce;padding:3px 0 10px;font-size:11px;cursor:pointer}

/* Align journal navigation with the Book; keep application sidebar visible. */
body.book-reader-in-dashboard #bookQuickRail #shelfBookQuickNav{position:fixed!important;z-index:1102;margin:0!important;max-height:none!important;min-height:0!important;box-sizing:border-box}
body.book-reader-in-dashboard .sidebar{position:relative;z-index:1103}

/* BOOK-01: Real dashboard integration, not a floating replica of the dashboard.
   The existing main workspace and the existing quick rail own their content. */
.app > .main.book-reader-workspace-active{padding:8px 12px 10px!important;min-width:0;min-height:0}
.app > .main.book-reader-workspace-active > #moduleHost,
.app > .main.book-reader-workspace-active > #appError{display:none!important}
.app > .main > .shelf-book-reader-dashboard{
  position:relative!important;inset:auto!important;
  z-index:1!important;display:block;
  width:100%!important;max-width:100%!important;
  height:calc(100dvh - 115px)!important;min-height:500px;
  margin:0!important;
}
.app > .main > .shelf-book-reader-dashboard .shelf-book-backdrop{border-radius:9px}
.app > .main > .shelf-book-reader-dashboard .shelf-book-shell{height:100%;padding:7px 7px 5px}
.app > .main > .shelf-book-reader-dashboard .shelf-book-stage{padding:9px 31px 6px}
.app > .main > .shelf-book-reader-dashboard .shelf-book-binding{width:100%;max-width:100%;height:100%}
body.book-reader-in-dashboard #bookQuickRail{z-index:2!important;overflow:hidden}
body.book-reader-in-dashboard #bookQuickRail #shelfBookQuickNav{
  position:relative!important;inset:auto!important;
  top:auto!important;left:auto!important;right:auto!important;
  width:100%!important;height:100%!important;
  max-height:none!important;overflow:hidden;
  padding:5px 0 0!important;margin:0!important;
  border:0!important;background:transparent!important;
}
body.book-reader-in-dashboard #bookQuickRail > .book-quick-rail-inner{display:none!important}
@media(max-width:1379px){
  body.book-reader-in-dashboard #bookQuickRail{display:block}
}
@media(max-width:820px){
  .app > .main > .shelf-book-reader-dashboard{height:70dvh!important;min-height:450px}
  body.book-reader-in-dashboard #bookQuickRail #shelfBookQuickNav{min-height:320px}
}

/* Journal appearance follows the dashboard's existing three-area rhythm:
   28px panel top, 32px work-area gutter, and card-styled context navigation.
   No new dashboard shell or standalone side panel. */
@media(min-width:1380px){
  .app > .main.book-reader-workspace-active{
    padding:28px 14px 14px 32px!important;
  }
  .app > .main > .shelf-book-reader-dashboard{
    height:calc(100dvh - 138px)!important;
    min-height:500px;
    overflow:visible;
  }
  .app > .main > .shelf-book-reader-dashboard .shelf-book-shell{
    box-sizing:border-box;
    border:1px solid var(--border);
    border-radius:15px;
    background:var(--surface);
    padding:11px 12px 10px;
    box-shadow:0 5px 18px rgba(16,23,25,.035);
  }
  .app > .main > .shelf-book-reader-dashboard .shelf-book-backdrop{display:none}
  .app > .main > .shelf-book-reader-dashboard .shelf-book-stage{padding:10px 31px 6px}
  body.book-reader-in-dashboard #bookQuickRail{
    padding-top:28px!important;
    padding-left:7px!important;
    padding-right:22px!important;
  }
  body.book-reader-in-dashboard #bookQuickRail #shelfBookQuickNav{
    box-sizing:border-box;
    height:calc(100dvh - 138px)!important;
    padding:13px 12px!important;
    border:1px solid var(--border)!important;
    border-radius:15px;
    background:var(--surface)!important;
    box-shadow:0 5px 18px rgba(16,23,25,.035);
  }
}

/* Use the EXISTING Daily workspace grid and its dashboard gutters.
   Keep its native two panel columns mounted; reveal them again on closing
   without recreating the dashboard or moving its modules. */
#dailyPlannerRoot .daily-workspace.book-reader-workspace-active{
  position:relative;
  min-width:0;
  align-items:stretch;
}
#dailyPlannerRoot .daily-workspace.book-reader-workspace-active > .daily-left-column,
#dailyPlannerRoot .daily-workspace.book-reader-workspace-active > .daily-main-column{
  display:none!important;
}
#dailyPlannerRoot .daily-workspace > .shelf-book-reader-dashboard{
  position:relative!important;
  inset:auto!important;
  z-index:1!important;
  grid-column:1/-1!important;
  width:100%!important;
  max-width:100%!important;
  height:calc(100dvh - 138px)!important;
  min-height:480px;
}
#dailyPlannerRoot .daily-workspace > .shelf-book-reader-dashboard .shelf-book-shell{
  border:1px solid var(--border);
  border-radius:15px;
  background:var(--surface);
  box-shadow:0 5px 18px rgba(16,23,25,.035);
  padding:11px 12px 10px;
}
#dailyPlannerRoot .daily-workspace > .shelf-book-reader-dashboard .shelf-book-backdrop{display:none}
@media(min-width:1380px){
  .app > .main:has(#dailyPlannerRoot .daily-workspace.book-reader-workspace-active){
    padding:28px 14px 14px 32px!important;
  }
}

/* Journal dashboard polish: keep native sidebar and right rail anchored.
   Earlier position:relative overrides added an unwanted 96px offset. */
@media(min-width:1380px){
  body.book-reader-in-dashboard .app > .sidebar{
    position:sticky!important;
    top:96px!important;
    z-index:5!important;
  }
  body.book-reader-in-dashboard .app > #bookQuickRail{
    position:sticky!important;
    top:96px!important;
    z-index:5!important;
    padding-top:28px!important;
  }
  body.book-reader-in-dashboard #bookQuickRail #shelfBookQuickNav{
    height:calc(100dvh - 120px)!important;
  }
}
/* The printed book is the title surface; remove its duplicated toolbar.
   Its actions live in the native context rail. */
#dailyPlannerRoot .daily-workspace > .shelf-book-reader-dashboard .shelf-book-toolbar{
  display:none!important;
}
#dailyPlannerRoot .daily-workspace > .shelf-book-reader-dashboard .shelf-book-shell{
  grid-template-rows:minmax(0,1fr) auto;
}
.shelf-book-nav-actions{display:flex;gap:7px;margin:0 0 12px}
.shelf-book-nav-actions button{flex:1;min-width:0;padding:8px 6px;border:1px solid #45646b;border-radius:6px;background:#254246;color:#eaf3ef;font-size:11px;font-weight:700;cursor:pointer}
.shelf-book-nav-actions button:hover{background:#315b5c}
