/* Layout glue only. Original DS/canvas/site CSS owns page presentation. */
#gr-status:empty { display:none; }
#gr-status { max-width:1200px; margin:12px auto; padding:0 20px; }
.grimoire-has-bottom-nav .site-footer { padding-bottom:calc(72px + env(safe-area-inset-bottom,0px)); }
#gm-main { max-width:1180px; margin-inline:auto; padding-inline:24px; }
@media (min-width:1280px) { .grimoire-has-bottom-nav .site-footer { padding-bottom:0; } }

/* Preserve original source navigation groups within the requested fixed bar. */
.grimoire-source-nav { display:flex; align-items:center; }
.grimoire-bottom-nav .grimoire-source-nav { width:100%; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.grimoire-bottom-nav .site-navgroup { min-width:0; display:flex; justify-content:center; }
.grimoire-bottom-nav .site-submenu { top:auto; bottom:100%; left:auto; right:0; max-height:min(65vh,480px); overflow-y:auto; }

/* Original mobile header hides the name when an avatar exists. Keep the same
   account-name component visible if the verified identity has no picture. */
.site-topbar .grimoire-account-no-avatar .site-account-name { display:inline; }

/* Restored original Great Library icon beside the shell brand text. */
.grimoire-app .gl-topbar__brand { display:inline-flex; align-items:center; gap:.625rem; }
.grimoire-app .gl-topbar__brand > .grimoire-brand-icon { width:32px; height:32px; display:block; flex:none; object-fit:contain; }

/* L-08 (Vellum shared reader): a dialog or notice opened from the sticky reader bar must use the whole screen.
   The bar's blur/transform made it the dialog's containing block, so the dialog was cut off (P-G-VISUAL findings, 7 Nov). */
.reader__bar:has([role="dialog"], dialog[open], .site-toast) { backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; }

/* Owner Share on every item (12 Nov 2026). Site tokens only. */
.gr-share-btn{display:block;margin:6px auto 0}
dialog.gr-share{max-width:min(520px,calc(100vw - 32px));width:100%;background:var(--gl-panel);color:var(--gl-text);border:1px solid var(--gl-rule-strong);border-radius:var(--gl-radius-lg);padding:var(--gl-space-5)}
dialog.gr-share::backdrop{background:rgba(0,0,0,.55)}
dialog.gr-share h2{margin:0 0 var(--gl-space-2);font-size:var(--gl-size-h3)}
.gr-share__muted{color:var(--gl-muted)}
.gr-share__row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.gr-share__form{display:grid;gap:10px;margin:var(--gl-space-3) 0}
.gr-share__form label{display:grid;gap:4px}
.gr-share__form .gr-share__check{display:flex;gap:8px;align-items:center}
.gr-share__note{min-height:1.5em}
dialog.gr-share{box-sizing:border-box;overflow-x:hidden;font-family:var(--gl-ui)}
dialog.gr-share .gl-input{box-sizing:border-box;width:100%;max-width:100%}

/* Keep repeated destinations in the visible mobile primary bar; retain unique footer links. */
@media (max-width:1279.98px) { .grimoire-has-bottom-nav:has([data-chrome-bottom]:not([hidden])) .site-footer [data-footer-primary] { display:none; } }

/* The existing audio dock must leave the existing fixed primary navigation reachable. */
@media (max-width:1279.98px) { body:has(.grimoire-has-bottom-nav [data-chrome-bottom]:not([hidden])) .site-audio-dock { bottom:calc(72px + env(safe-area-inset-bottom,0px)) !important; max-height:calc(100dvh - 160px - env(safe-area-inset-bottom,0px)); overflow-y:auto; } }

/* T5B: the Documents hero has no image; retain Parchment tokens in its light/sepia surface. */
[data-gl-theme="light"] .grimoire-documents-hero .site-hero__title { color: var(--gl-text-strong); }
[data-gl-theme="light"] .grimoire-documents-hero .site-hero__lede { color: var(--gl-muted); }

/* T5B step1/R-044: exact Parchment SEPIA_TOKENS, scoped to the private shell.
   Generated from app/src/parchment/sepia.ts; no new stored theme or palette. */
html[data-grimoire-paper="sepia"], html[data-grimoire-paper="sepia"] [data-gl-theme] {
  --gl-ink: #F4ECD8;
  --gl-ink-deep: #EADFC4;
  --gl-panel: #FBF6E9;
  --gl-panel-2: #EFE4CB;
  --gl-shelf: #FBF6E9;
  --gl-rule: #DCCBA6;
  --gl-rule-soft: #E7DABB;
  --gl-rule-strong: #7A5A9E;
  --gl-text: #3B2A1A;
  --gl-text-strong: #24170B;
  --gl-muted: #5C4731;
  --gl-faint: #6A5540;
  --gl-lamp: #7A4F08;
  --gl-lamp-soft: rgba(122, 79, 8, .14);
  --gl-amethyst: #5B338C;
  --gl-wash: rgba(91, 51, 140, .08);
  --gl-glow: rgba(122, 79, 8, .06);
  --gl-action: #5B338C;
  --gl-action-hover: #482872;
  --gl-action-text: #FFFFFF;
  --gl-link: #5B338C;
  --gl-link-hover: #7A4F08;
  --gl-focus: #5B338C;
  --gl-danger: #A3261E;
  --gl-danger-ground: #A3261E;
  --gl-success: #3A6528;
  --gl-info: #0E636B;
  --gl-warning: #7A4F08;
  --gl-shadow-card: 0 1px 2px rgba(59, 42, 26, .08), 0 10px 24px -16px rgba(59, 42, 26, .32);
  --gl-shadow-frame: 0 30px 70px -44px rgba(59, 42, 26, .5);
  --gl-shadow-lift: 0 0 0 1px var(--gl-amethyst), 0 14px 30px -16px rgba(59, 42, 26, .4);
  --gl-page-wash: none;
  color-scheme: light;
}
html[data-grimoire-paper="sepia"], html[data-grimoire-paper="sepia"] body,
html[data-grimoire-paper="sepia"] .gl-root.site-root { background: var(--gl-ink); color: var(--gl-text); color-scheme: light; }
html[data-grimoire-paper="sepia"] { scrollbar-color: var(--gl-rule-strong) transparent; }
html[data-grimoire-paper="sepia"]::-webkit-scrollbar-track { background: transparent; }
/* Existing Parchment Sepia fixed-colour exceptions applied to the same host. */
html[data-grimoire-paper="sepia"] .grimoire-app .gl-btn--lamp { background: #E3B85C; border-color: #E3B85C; color: #160E27; }
html[data-grimoire-paper="sepia"] .grimoire-app .gl-btn--lamp:hover:not(:disabled) { background: #D9A93F; }
html[data-grimoire-paper="sepia"] .gl-root a.gl-btn--lamp,
html[data-grimoire-paper="sepia"] .gl-root a.gl-btn--lamp:hover { color: #160E27; }
html[data-grimoire-paper="sepia"] .grimoire-app code { color: #5B338C; }
html[data-grimoire-paper="sepia"] .grimoire-app pre { color: #3B2A1A; }
html[data-grimoire-paper="sepia"] .grimoire-app mark { background: #EFD58F; color: #24170B; }

/* Existing Parchment active-panel layer: keep Aa controls above the persistent dock. */
#grimoire-app[data-host="irina"] #reader-aa { z-index:100; }

/* Existing Grimoire bottom-navigation clearance; reader and desktop keep Parchment dock placement. */
@media (max-width:1279.98px) {
  #grimoire-app[data-host="irina"] > .grimoire-bottom-nav:not([hidden]) ~ #gr-persistent-audio-host .listen-player { bottom:calc(72px + env(safe-area-inset-bottom,0px)); }
}
