/* Shared reader controls retain the green, parchment and gold identity. */
:root{--polish-ink:#284335;--polish-green:#365840;--polish-line:#b8b695}
body{color:var(--polish-ink)}
button,.button{min-height:44px;border-radius:10px;font-weight:650;line-height:1.35}
button:not(.secondary):not(.memory-book-cover):not(.photo-view-nav):not(.tree-tool-button):not(.book-quill){background:var(--polish-green);color:#fff9ea;border-color:var(--polish-green)}
button.secondary,.button.secondary{background:#f5f2e7;color:var(--polish-ink);border:1px solid var(--polish-line)}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #ad874c;outline-offset:3px}
header{background:#e8ebdb;border:1px solid #c9c7ac;box-shadow:none;gap:14px;padding:16px 24px}
header .site-logo{max-width:180px}header .actions{gap:10px}
.book-caption,.book-intro{display:none!important}
#memorialLayout{grid-template-columns:minmax(0,1fr)!important;max-width:1000px;margin:24px auto}
#memorialBook{width:100%;min-width:0;text-align:center}
.memorial-timeline{order:2;max-width:850px;width:100%;margin:36px auto 0;text-align:left}
#story{order:3}.memorial-timeline:has(#timelineEvents:empty){display:none}
.memory-book-cover{width:min(420px,calc(100vw - 48px))!important;min-height:0!important;margin:16px auto!important;padding:24px!important;aspect-ratio:3/4;height:auto!important}
.book-cover-photo{width:clamp(130px,23vw,210px)!important;height:clamp(150px,26vw,235px)!important;object-fit:contain!important;margin:16px auto!important}
.book-cover-name{font-size:clamp(28px,4vw,39px)!important;line-height:1.15!important;overflow-wrap:normal!important;word-break:normal!important}
.book-cover-dates{font-size:15px!important;line-height:1.5!important}.book-cover-quote{font-size:18px!important;line-height:1.5!important;margin:12px 0!important}
.book-cover-label{font-size:12px!important}.book-cover-open{margin-top:14px!important;font-size:16px!important}
#storybookTourStart{background:transparent;border:0;min-height:36px;padding:6px 10px;font-size:13px}
#storybookTourStart+span{display:none}.book-inline-edit{display:none!important}
body.storybook-editing .book-inline-edit{display:inline-flex!important}
.reader-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin:12px 0}.reader-tools button{font-size:14px;padding:9px 14px}
.reader-tools [data-save-state]{font-size:13px;flex:1 1 100%;color:#52654f}
#readerStatus[data-error=true]{color:#8f2e29;font-weight:650}
#memorialOwnership{max-width:100%;font-size:15px;margin:20px 0}.polish-guest-banner{padding:12px 20px;background:#365840;color:#fff9ea;text-align:center;position:sticky;top:0;z-index:1100}.polish-guest-banner a{color:inherit;margin-left:12px}
.book-quick-nav{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 0;margin:0;justify-content:center}.book-quick-nav button{font-size:14px;padding:8px 12px}
.polish-share-qr{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin:18px 0}.polish-share-qr img{width:160px;height:160px;background:#fff;border-radius:8px}.polish-share-qr p{max-width:300px}
.polish-trust{margin:24px 0;padding:18px;background:#eef0e4;border:1px solid #c9c7ac;border-radius:12px;text-align:left}.polish-trust summary{cursor:pointer;font-weight:650}.polish-trust p{font-size:15px;line-height:1.65}
#timelineDuplicateStatus:not(:empty){padding:14px;background:#fff2cf;border-left:4px solid #ad874c;color:#503d19}
.obituary-review-warning{border-left:4px solid #ad874c;background:#fff2cf;padding:12px}.obituary-duplicate{opacity:.85;background:#eef0e4}
.story-atmosphere{opacity:.22!important}.family-doodle-backdrop,.family-doodle svg{animation:none!important}.story-motion-pending{opacity:1!important;transform:none!important;translate:none!important}
@media(max-width:640px){header{padding:12px;gap:10px;flex-wrap:wrap}header .site-logo{max-width:130px}header .actions{order:3;width:100%;justify-content:center}header .actions button{font-size:13px;padding:8px 10px}#familyButton{margin-left:auto;font-size:14px}#memorialLayout{margin:12px auto}.memory-book-cover{padding:18px!important;max-height:74svh;aspect-ratio:auto}.book-cover-photo{height:180px!important;width:160px!important}.book-quick-nav{gap:4px}.book-quick-nav button{font-size:12px;padding:7px 9px;min-height:42px}.reader-tools{gap:6px}}
@media(prefers-reduced-motion:reduce){.story-atmosphere,.family-doodle-backdrop{display:none!important}}
/* One chapter shortcut, with the cover fully visible on typical screens. */
.book-toolbar>button[onclick="openMemoryBookIndex()"]{display:none!important}
@media(min-width:641px){.memory-book-cover{width:min(360px,calc(100vw - 48px))!important}.book-cover-photo{width:170px!important;height:180px!important;margin:12px auto!important}.book-cover-name{font-size:33px!important}.book-cover-quote{font-size:17px!important;margin:10px 0!important}}

#autoPublishStatus{padding:12px 18px;border-radius:12px;background:#fff2cf;color:#654b1f;font-weight:700;border:1px solid #d5bd80}#autoPublishStatus[data-save-state="saved"]{background:#e6f3e8;color:#155a38;border-color:#9bc3a5}#autoPublishStatus[data-save-state="error"],#autoPublishStatus[data-save-state="offline"]{background:#fff0df;color:#853c1c;border-color:#dba775}

/* Gilt binding, fine paper, and a fixed ribbon of reading controls. */
body > header.lasting-header { top: var(--lasting-banner-height, 0px); }
#memorialBook {
  position: relative;
  padding: clamp(16px, 3vw, 34px) 12px clamp(22px, 4vw, 44px);
  border: 1px solid #c1b99b;
  border-radius: 28px;
  background: radial-gradient(ellipse at 50% 42%, #fff9e7 9%, #f5edda9c 60%, #e1e8d7bd);
  box-shadow: inset 0 0 0 5px #fffaf353;
}
#memorialBook .memory-book-cover, #memoryBookReader > .memory-book-cover {
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, #dad6a00b 2px 3px),
    radial-gradient(ellipse at 74% 18%, #8a9d6150, transparent 63%),
    linear-gradient(90deg, #112d25 0%, #476754 4%, #204738 8%, #1d473b 84%, #15392e 100%);
  color: #fff3d3;
  border: 1px solid #987842;
  border-radius: 7px 16px 16px 7px;
  box-shadow: 4px 3px 0 #8f7446, 8px 7px 0 #e5d8b7, 10px 9px 0 #f7eccd,
    13px 12px 0 #bbae89, 19px 22px 32px #24362840;
  overflow: visible;
  isolation: isolate;
}
#memorialBook .memory-book-cover {
  width: min(360px, calc(100% - 22px)) !important;
  padding: 25px clamp(17px, 4vw, 35px) !important;
  max-height: none;
}
#memorialBook .memory-book-cover::before, #memoryBookReader > .memory-book-cover::before {
  inset: 13px 12px 13px 23px;
  border: 1px solid #ceaf6c;
  outline: 1px solid #aa904466;
  outline-offset: -5px;
  border-radius: 3px 10px 10px 3px;
}
#memorialBook .memory-book-cover::after, #memoryBookReader > .memory-book-cover::after {
  top: 9%;
  bottom: 9%;
  left: 5px;
  width: 12px;
  background: repeating-linear-gradient(180deg, #c3a45b 0 2px, transparent 2px 8%);
  opacity: .7;
  box-shadow: none;
}
#memorialBook .book-cover-label {
  margin: 0;
  color: #f1d795;
}
#memorialBook .book-cover-photo, #memoryBookReader > .memory-book-cover .book-cover-photo {
  border: 3px double #e6c87f;
  background: #f3e7c7;
  box-shadow: 0 0 0 4px #dfc07932, 0 4px 12px #10251e5c;
}
#memorialBook .book-cover-name {
  margin: 3px 0 5px;
  overflow-wrap: anywhere !important;
}
#memorialBook .book-cover-open {
  margin-top: 6px !important;
  padding: 8px 18px;
  border: 1px solid #d8bc7e;
  border-radius: 4px 9px 4px 9px;
  color: #fff2cc;
  background: #101e1847;
}
@media (hover: hover) {
  #memorialBook .memory-book-cover:hover .book-cover-open {
    color: #1b3d2f;
    background: #f2d699;
  }
}
body.book-reading #memoryBookReader {
  background: radial-gradient(ellipse at 75% 4%, #f8f0db, transparent 70%), #e9e1c9;
  border-left-color: #264b3c;
}
body.book-reading #memoryBookReader > .book-toolbar {
  border-bottom: 1px solid #b7a57a;
}
#memoryBookReader .book-quick-nav {
  flex: none;
  position: relative;
  gap: 5px;
  margin: 0 0 6px;
  padding: 7px 5px;
  border: 1px solid #bca87a;
  border-radius: 8px;
  background: linear-gradient(#fffaf0, #eee3ca);
  box-shadow: 0 2px 8px #53432818;
}
#memoryBookReader .book-quick-nav button {
  min-height: 44px;
  padding: 6px clamp(9px, 2vw, 20px);
  border-color: #b0a381;
  border-radius: 7px 12px 7px 7px;
  background: linear-gradient(#fff9eb, #e9dfc6);
  color: #274739;
  box-shadow: 0 2px #a08e6c5e;
}
#memoryBookReader .book-quick-nav button[aria-current],
#memoryBookReader .book-quick-nav button:last-of-type {
  background: linear-gradient(125deg, #36634d, #214639);
  border-color: #577561;
  color: #fff4d7;
}
#memoryBookReader .lasting-scroll-progress { inset-inline: 8px; }
#memoryBookReader .lasting-scroll-progress::after { transform: scaleX(var(--lasting-progress, 0)); }
body.book-reading #memoryBookReader > #bookPage {
  border: 1px solid #b9aa87;
  border-radius: 5px 12px 10px 5px;
  background: linear-gradient(90deg, #e7d9b9 0, #fffaf0 20px, #fffaf2 88%, #f5eddc);
  box-shadow: inset 4px 0 8px #8a72432b, 2px 2px 0 #d5c8a6, 4px 4px 0 #f6edd6;
}
#memoryBookReader #bookPage .sectionhead h2, #memoryBookReader #bookIndex h2 {
  color: #244b3c;
}
#memoryBookReader #bookIndex .book-index-list button {
  background: linear-gradient(110deg, #244a3b, #3b5f46);
  color: #fff5dd;
  border-color: #678068;
  border-radius: 8px 14px 8px 8px;
  box-shadow: inset 0 0 0 2px #edcc8540, 0 2px 4px #2c422c31;
  overflow-wrap: anywhere;
}
#memoryBookReader .book-page-number { color: #544228; }
#memorialLayout .memorial-intro { border-color: #beae88; background: linear-gradient(115deg, #fff9ed, #f1ead8); }
#memorialLayout #story > .grid > article { box-shadow: 0 5px 22px #3c45281a; }
@media (max-width: 720px) {
  body.book-reading #memoryBookReader > #bookPage { padding: 12px 9px 12px 12px; }
  #memoryBookReader .book-quill-rest { height: 66px; }
  #memoryBookReader .book-quill-rest #bookQuill { height: 66px; }
  #memoryBookReader .book-quill-rest #bookQuill .quill-feather { height: 47px; }
}
@media (max-width: 360px) {
  #memoryBookReader .book-quick-nav button { font-size: 11px; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #memorialBook .memory-book-cover:hover { transform: none; }
}
