/**
 * scope-view.book.css — HIS OPEN BOOK'S LOOK, ON ANY PAGE: the book's tokens and the open book (ONE-BOOK-A, KNOMAD-OFFICE
 * designs/ready-shelf/one-book-a/PREP.md §2; Doug 6c6322f: the data book Sim Fire draws "is the one that we should be using
 * everywhere").
 *
 * CUT, UNCHANGED, FROM scope-view.hud.css (its tokens and THE LOG BOOK, OPEN), which loads only with Sim Fire: this sheet
 * loads at boot (index.html), so the open book is drawn as itself wherever it opens. The tokens are the book's own, not
 * the kit layer's (they were scoped under `.scope-kit-layer`; --logbook-* is declared nowhere else). Sim Fire's box stays
 * the kit layer's (`.scope-kit-layer .scope-logbook-open`: absolute, held by the KNOMAD's hand), so Sim Fire's book keeps
 * its look byte for byte. Its name keeps it in the glass's family of sheets (check:scope-layers reads
 * `scope-view*.css`), where its layer names are read.
 */

/* THE BOOK'S TOKENS (LOGBOOK-D2-S2; Doug, 2026-10-13: "give me the book cover in the color of the Petersons Field
   Guide lighter green instead of the brown" ... "i like the fonts everytwhere"). Defined once, here, for the closed
   book on the bench and the open book: the cover's green and its dark green ink, his hand (the app's own handwriting
   faces, loaded by index.html and mobile.html), and the pre-printed form's typewriter face. The closed book's picture
   on any page (FIELD-KIT-DOORS-1, `.scope-kit-picture--logbook`) reads the same tokens, and so does the target's face on
   the drop sheet (MAP-TO-TARGET-1 B1b, the office's ruling (b): the figures written on a station's paper in the Range
   Card's own hand, his ink or the printed form's as the one decider `DataBookLeaves.handOf` says; canvas.css draws them
   with these tokens, never a copy of the faces). */
.scope-logbook-carried,
.scope-logbook-open,
.scope-kit-picture--logbook,
.drop-sheet .ds-spaper {
  --logbook-cover: #a9c47f;
  --logbook-cover-face: #b7d08e;
  --logbook-cover-shade: #8daa62;
  --logbook-cover-rule: #6e8c47;
  --logbook-ink: #1f3b1d;
  --logbook-hand: "Caveat", "Architects Daughter", cursive;
  --logbook-hand-alt: "Architects Daughter", "Caveat", cursive;
  --logbook-type: "Courier Prime", "Courier New", Courier, monospace;
  --logbook-pen: #1d3557;
  --logbook-print: #3a3a3a;
}

/* ── THE LOG BOOK, OPEN (LOGBOOK-D2) ─────────────────────────────────────────
   A press on the closed book's cover opens the book itself in the kit layer:
   its boards, its leaf drawn as the range card (range-card-vanilla.css draws the
   paper), and its leaves' tabs on the page's edge. It is held by the KNOMAD's
   hand (its head is the grip, its corner sizes it); its size is set inline
   (6.0 x 5.0 in at twice the KNOMAD's scale, scope_view_logbook_pages.js);
   these are the pre-JS fallback. It is equipment: Hide HUD names nothing here. */

.scope-kit-layer .scope-logbook-open,
.scope-logbook-open[data-book-host="page"] {
  position: absolute;
  width: 552px;
  height: 460px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 6px 8px 16px;
  z-index: var(--layer-kit-book-open);
  pointer-events: auto;
  touch-action: none;
  background: var(--logbook-cover);
  border: 3px solid var(--logbook-ink);
  border-radius: 6px;
  box-shadow: inset 10px 0 0 var(--logbook-cover-shade), 0 14px 30px rgba(0, 0, 0, 0.6);
}

.scope-logbook-open__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  flex: 0 0 auto;
}

.scope-logbook-open__title {
  margin: 0;
  overflow: hidden;
  color: var(--logbook-ink);
  font: 700 12px/1 var(--logbook-type);
  letter-spacing: 1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-logbook-open__close {
  position: relative;
  z-index: var(--layer-carried-book-close);
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--logbook-ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: var(--logbook-ink);
  font: 700 15px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.scope-logbook-open__spread {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.scope-logbook-open__leaf {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  border-radius: 2px;
  background: #efe8cf;
  touch-action: pan-y;
}

.scope-logbook-open__leaf .rc-paper-page {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  box-shadow: none;
  font-family: var(--logbook-type);
}

/* HIS HAND AND THE PRINTED FORM (ask item 8): every value he entered, or his record holds as his, in his hand; the
   form's own words, and a value the maker, a default, the simulator or a tool supplied, in the typewriter's. */
.scope-logbook-open__leaf .rc-ink,
.scope-logbook-open__leaf .rc-paper-page__identity b.rc-ink {
  color: var(--logbook-pen);
  font-family: var(--logbook-hand);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
}

.scope-logbook-open__leaf .rc-paper-entry strong.rc-ink { font-family: var(--logbook-hand-alt); font-size: 13px; }

.scope-logbook-open__leaf .rc-print,
.scope-logbook-open__leaf .rc-paper-page__identity b.rc-print {
  color: var(--logbook-print);
  font-family: var(--logbook-type);
  font-size: 11px;
  font-weight: 400;
}

.scope-logbook-open__leaf .rc-known {
  margin-left: 4px;
  padding: 0 3px;
  border: 1px solid currentColor;
  border-radius: 3px;
  color: var(--logbook-print);
  font: 400 8px/1.4 var(--logbook-type);
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.scope-logbook-open__leaf .rc-paper-page__form-title {
  margin: 0;
  font: 700 10px/1.2 var(--logbook-type);
  letter-spacing: 1px;
}

/* HIS THREE PRESSES ON A LEAF (ONE-BOOK-B1, data_book_leaf_acts.js): a day of the list, its heading itself, underlined
   while it is the day drawn below; RESTORE on a day's SET ASIDE line; the book by signature and the signing list. Each
   is printed on the form, in the typewriter's face, never in his hand. */
.scope-logbook-open__leaf .rc-paper-entry__day {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scope-logbook-open__leaf .rc-paper-entry__day[aria-pressed="true"] strong { text-decoration: underline; }

.scope-logbook-open__leaf .rc-paper-entry__day:focus-visible,
.scope-logbook-open__leaf .rc-paper-restore:focus-visible,
.scope-logbook-open__leaf .rc-paper-signer__filter:focus-visible { outline: 2px solid var(--logbook-ink); outline-offset: 1px; }

.scope-logbook-open__leaf .rc-paper-aside h4 { margin: 6px 0 2px; font: 700 10px/1.2 var(--logbook-type); letter-spacing: 1px; }
.scope-logbook-open__leaf .rc-paper-aside__list { margin: 0; padding: 0; list-style: none; }

.scope-logbook-open__leaf .rc-paper-restore,
.scope-logbook-open__leaf .rc-paper-signer__filter {
  padding: 0 4px;
  border: 1px solid var(--logbook-print);
  border-radius: 3px;
  background: none;
  color: var(--logbook-print);
  font: 700 9px/1.6 var(--logbook-type);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.scope-logbook-open__leaf .rc-paper-signer__filter[aria-pressed="true"] { border-color: var(--logbook-ink); color: var(--logbook-ink); text-decoration: underline; }

.scope-logbook-open__leaf .rc-paper-signer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 2px 0 6px;
  font: 400 9px/1.4 var(--logbook-type);
}

.scope-logbook-open__leaf .rc-paper-signer__filters { display: inline-flex; gap: 4px; }
.scope-logbook-open__leaf .rc-paper-signer__signing select { font: 400 10px var(--logbook-type); }

/* The leaf flips over as it turns: on, its outer edge swinging to the spine; back, the other way. */
.scope-logbook-open__leaf--on { animation: scope-logbook-leaf-on 260ms ease-out; transform-origin: left center; }
.scope-logbook-open__leaf--back { animation: scope-logbook-leaf-back 260ms ease-out; transform-origin: right center; }

@keyframes scope-logbook-leaf-on {
  from { transform: perspective(900px) rotateY(-70deg); opacity: 0.4; }
  to { transform: perspective(900px) rotateY(0); opacity: 1; }
}

@keyframes scope-logbook-leaf-back {
  from { transform: perspective(900px) rotateY(70deg); opacity: 0.4; }
  to { transform: perspective(900px) rotateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .scope-logbook-open__leaf--on,
  .scope-logbook-open__leaf--back { animation: none; }
}

/* The page's edge: the leaves' fore-edge, pressed to turn on or dragged either way. */
/* The edge and the tabs stand above the leaf, so a leaf still swinging over never takes the next press. */
.scope-logbook-open__edge {
  position: relative;
  z-index: var(--layer-carried-book-edge);
  flex: 0 0 14px;
  margin: 4px 0;
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(to right, #efe8cf 0, #efe8cf 2px, #d9d0b0 2px, #d9d0b0 3px);
  box-shadow: inset 2px 0 3px rgba(0, 0, 0, 0.18);
  cursor: grab;
  touch-action: none;
}

.scope-logbook-open__edge:focus-visible { outline: 2px solid var(--logbook-ink); outline-offset: -2px; }

.scope-logbook-open__tabs {
  position: relative;
  z-index: var(--layer-carried-book-tabs);
  display: flex;
  flex: 0 0 84px;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
}

.scope-logbook-open__tab {
  padding: 5px 6px;
  border: 1px solid var(--logbook-cover-rule);
  border-left: 0;
  border-radius: 0 4px 4px 0;
  background: var(--logbook-cover-face);
  color: var(--logbook-ink);
  font: 700 10px/1.15 var(--logbook-type);
  text-align: left;
  cursor: pointer;
}

.scope-logbook-open__tab[aria-pressed="true"] {
  background: #efe8cf;
}

.scope-logbook-open__tab--shelf {
  margin-top: auto;
  background: var(--logbook-cover-shade);
}

/* THE BOOK ON A PAGE (ONE-BOOK-A2): with no host handed in it is a child of the body, laid out here: fixed in the
   middle of the window at the open book's size, in the glass's one list at the Range Card panel's plane
   (--layer-root-book-page, under the glass), over the page it is opened on and never in it. No hand holds it there, so it has no grip.
   ON THE PHONE (ONE-BOOK-B2) the window is narrower than the book: it is held inside the screen, 8 px from each edge, and
   a finger scrolls its leaf up and down (a drag along the page's edge still turns it). */
.scope-logbook-open[data-book-host="page"] {
  position: fixed;
  inset: 0;
  margin: auto;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  touch-action: pan-y;
  z-index: var(--layer-root-book-page);
}

/* The head is the grip: a book is held up by its boards. */
.scope-logbook-open-grab {
  position: absolute;
  left: 0;
  top: 0;
  right: 44px;
  height: 32px;
  z-index: var(--layer-carried-grip);
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  background: transparent;
}

.scope-logbook-open-resize {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 22px;
  height: 22px;
  z-index: var(--layer-carried-grip);
  border-radius: 50%;
  cursor: nwse-resize;
  touch-action: none;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  opacity: 0.35;
  transition: opacity 120ms ease;
}

.scope-kit-layer .scope-logbook-open:hover .scope-logbook-open-resize,
.scope-logbook-open-resize--active {
  opacity: 0.9;
}

.scope-logbook-open-grab:active,
.scope-logbook-open-grab--active,
.scope-kit-layer .scope-logbook-open-carried--carried,
.scope-kit-layer .scope-logbook-open-carried--carried * {
  cursor: grabbing;
}
