.pen-reading {
  overflow: hidden;
}

#report.pen-report {
  --pen-window-height: 100vh;
  --pen-page-height: max(var(--pen-window-height), 620px);
  --pen-safe-top: env(safe-area-inset-top, 0px);
  --pen-safe-bottom: env(safe-area-inset-bottom, 0px);
  height: var(--pen-window-height);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

@supports (height: 100dvh) {
  #report.pen-report { --pen-window-height: 100dvh; }
}

#report.pen-report::-webkit-scrollbar { display: none; }

.pen-page {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  height: var(--pen-page-height);
  padding: var(--pen-safe-top) env(safe-area-inset-right, 0px) var(--pen-safe-bottom) env(safe-area-inset-left, 0px);
  place-items: center;
  overflow: hidden;
  scroll-snap-align: start;
}

.pen-page-backdrop {
  position: absolute;
  inset: -16px;
  visibility: hidden;
  pointer-events: none;
  filter: blur(10px);
}

[data-pen-inline-bleed] .pen-page-backdrop,
[data-pen-block-bleed] .pen-page-backdrop { visibility: visible; }

.pen-backdrop-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 390px;
  height: 844px;
  transform: translate(-50%, -50%) scale(var(--pen-backdrop-scale, 1));
}

.pen-viewport {
  position: relative;
  width: min(100%, 500px, calc((var(--pen-page-height) - var(--pen-safe-top) - var(--pen-safe-bottom)) * 390 / 844));
  aspect-ratio: 390 / 844;
  overflow: hidden;
}

[data-pen-inline-bleed] .pen-viewport {
  --pen-mask: linear-gradient(90deg, transparent, #000 var(--pen-edge-fade, 8px),
    #000 calc(100% - var(--pen-edge-fade, 8px)), transparent);
  -webkit-mask-image: var(--pen-mask);
  mask-image: var(--pen-mask);
}

[data-pen-block-bleed] .pen-sheet {
  --pen-mask: linear-gradient(180deg, transparent, #000 11px, #000 calc(100% - 11px), transparent);
  -webkit-mask-image: var(--pen-mask);
  mask-image: var(--pen-mask);
}

@media (max-width: 599.98px) and (orientation: portrait) {
  #report.pen-report {
    /* Keep the middle 812 of the 844 design units reachable on shorter phones. */
    --pen-page-height: max(var(--pen-window-height), calc(100vw * 812 / 390));
  }
  .pen-page { padding: 0; }
  .pen-page-backdrop { display: none; }
  .pen-viewport {
    width: max(100%, calc(var(--pen-page-height) * 390 / 844));
  }
  [data-pen-inline-bleed] .pen-viewport,
  [data-pen-block-bleed] .pen-sheet {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .pen-reading dialog { width: 100%; }
}

@media (min-width: 600px), (orientation: landscape) {
  .pen-page-backdrop {
    inset: -32px;
    filter: blur(22px) saturate(.73);
  }
  .pen-page-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #3d291e30, transparent 42% 58%, #3d291e30);
  }
  .pen-viewport { --pen-edge-fade: 16px; }
}

.pen-sheet {
  transform: scale(var(--pen-scale, 1));
  transform-origin: top left;
  isolation: isolate;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.pen-near .pen-image { background-image: var(--pen-image); }
:where(.pen-action) {
  appearance: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
  font: inherit;
}

.pen-action:focus-visible { outline: 2px solid #754425; outline-offset: 2px; }
.pen-action-icon { display: block; width: 100%; height: 100%; }
.pen-sheet [data-pencil-name="页码"],
.pen-action[data-pencil-name="轻扫翻页提示"] { z-index: 50; }
.pen-action[data-pencil-name="轻扫翻页提示"]::after {
  content: "";
  position: absolute;
  inset: -12px;
}
.pen-text { white-space: pre-line; }
.pen-fit {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fit-text {
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-line;
  line-height: 1.25;
}
.fit-text-scroll { overflow: auto; scrollbar-width: thin; }
.fit-text-single { white-space: nowrap; }

.pen-preview-label, .pen-snapshot-period {
  position: absolute;
  z-index: 14;
  font-size: 12px;
  color: #65543a;
}

.pen-preview-label {
  top: 26px;
  right: 32px;
  min-height: 26px;
  padding: 1px 8px;
  border: 1px solid #b69679;
  border-radius: 15px;
  background: #fff9f0;
}

.pen-snapshot-period { top: 742px; left: 32px; }
#drawer-content > .pill + .rows, #drawer-content > .note + .roles { margin-top: 12px; }
#drawer-content > h3 { margin: 12px 0 4px; }

/* Calendar copy sits on the paper rather than on the illustrated tabletop. */
#together :is(.pen-FRLco, .pen-vK4XZ, .pen-n0bdJ, .pen-y8KTL, .pen-v1GxBV, .pen-u0ra5y, .pen-GW7AH) {
  left: 85px;
}
#together .pen-GW7AH { width: 250px; }
#together .pen-F8UL0 { left: 77px; }
#together .pen-f1JjS { left: 309px; }
#together .pen-u0ra5y {
  top: 566px;
  width: 254px;
  color: #5a3d27;
  font-size: 16px;
  line-height: 22px;
}
#together .pen-v1GxBV { top: 543px; }

.pen-reading-two-metrics :is(.pen-LdWki, .pen-uBJmO, .pen-D8ok3, .pen-jXorm) { translate: 0 28px; }
.pen-reading-two-metrics .pen-B8zoqL { translate: 0 46px; }
.pen-reading-two-metrics :is(.pen-OllHX, .pen-N3RDZ6, .pen-L8pK97, .pen-sQaqO) { translate: 0 -45px; }

/* The full character artwork and its shadows sit behind the clipped tea set. */
#table .pen-ChcQM { left: 83px; }
#table .pen-YG2qg { left: 130px; }
#table .pen-F5Y1RK { left: 155px; }
#table .pen-oSc8e { left: 263px; }
#table .pen-OcRpS { pointer-events: none; }

.store-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.store-timeline > li {
  display: grid;
  grid-template-columns: 68px 9px minmax(44px, .55fr) minmax(0, 1.5fr);
  align-items: start;
  column-gap: 8px;
  font-size: .875rem;
  line-height: 1.4;
}
.store-timeline-date,
.store-timeline-city,
.store-timeline strong {
  min-width: 0;
  padding-block: 7px;
}
.store-timeline-date {
  color: #785135;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.65;
  white-space: nowrap;
}
.store-timeline-city {
  color: #6e604c;
  overflow-wrap: anywhere;
}
.store-timeline strong { overflow-wrap: anywhere; }
.store-timeline-marker {
  position: relative;
  align-self: stretch;
  display: grid;
  justify-items: center;
  color: #ab532d;
}
.store-timeline-marker::before,
.store-timeline-marker::after { content: ""; }
.store-timeline-marker::before {
  position: absolute;
  inset-block: 0;
  width: 1px;
  background: #ddc4a6;
}
.store-timeline > :first-child .store-timeline-marker::before { top: 16px; }
.store-timeline > :last-child .store-timeline-marker::before { bottom: auto; height: 16px; }
.store-timeline > :only-child .store-timeline-marker::before { display: none; }
.store-timeline-marker::after {
  z-index: 1;
  margin-top: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
