/* The bottom sheet (citations, contents) shared by the reader. */

/* bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto;
  max-width: 640px; max-height: min(76vh, 680px);
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1);
}
.sheet-panel:focus { outline: none; }
@keyframes sheet-up { from { transform: translateY(48px); opacity: .3; } }
.sheet-top { display: flex; align-items: center; justify-content: center; position: relative;
             min-height: 40px; flex: none; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--ink-3); opacity: .5; }
.sheet-close { position: absolute; right: 6px; top: 0; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere;
  padding: 0 var(--gutter) 22px; font: .95rem/1.5 var(--sans);
}
.sheet-title { font: 700 1.1rem/1.3 var(--sans); margin: 0 0 12px; }
.sheet-quote { font: italic 400 .95rem/1.5 var(--serif); color: var(--ink-2); margin: 0 0 16px;
               padding-left: 12px; border-left: 3px solid var(--hl); }
.src-card { display: block; padding: 12px 14px; margin: 0 0 8px; border-radius: 14px;
            background: var(--raised); color: var(--ink); text-decoration: none; }
a.src-card:active { background: var(--hl-tint); }
.src-pub { display: flex; align-items: center; gap: 8px; font: 600 .78rem/1.2 var(--sans);
           color: var(--ink-2); margin-bottom: 6px; }
.src-init { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
            background: var(--ink); color: var(--paper); font: 700 .7rem/1 var(--sans);
            text-transform: uppercase; }
.src-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
             font: 550 .98rem/1.38 var(--sans); }
.src-via { margin: -2px 0 12px 14px; font: .8rem/1.4 var(--sans); color: var(--ink-3); }
.src-via a { color: var(--ink-3); }
.sheet-more { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: 4px;
              font: 600 .88rem/1 var(--sans); color: var(--ink-2); }
.sheet-body .toc { display: flex; flex-direction: column; }
.sheet-body .toc a { display: flex; align-items: center; min-height: 50px; padding: 0 4px 0 14px;
                     position: relative; border-bottom: 1px solid var(--rule); color: var(--ink);
                     text-decoration: none; font: 500 1rem/1.3 var(--sans); }
.sheet-body .toc a.on { font-weight: 650; }
.sheet-body .toc a.on::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
                                width: 3px; border-radius: 2px; background: var(--hl); }
