.day-stream-item article > p:empty {
  display: none;
}

.stream-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stream-image-gallery img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  border: 1px solid rgba(17, 17, 17, 0.46);
  background: #fffdf5;
  object-fit: contain;
}

.month-grid .day-tile.has-public-stream:not(.is-filled)::after {
  position: absolute;
  right: 5px;
  bottom: 4px;
  content: attr(data-stream-count) " 条";
  color: rgba(17, 17, 17, 0.58);
  font-size: 0.45rem;
  font-weight: 800;
}

/* A compact month index that shares the title's visible bottom edge. */

.month-journal .month-sheet-heading:has(.month-index) {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 33%);
  align-items: end;
  column-gap: 32px;
}

.month-journal .month-sheet-heading:has(.month-index) .month-title-copy {
  display: block;
  width: auto;
}

.month-journal .month-sheet-heading:has(.month-index) .month-title-copy h1 {
  margin: 0;
}

.month-index {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  width: 100%;
  height: 20px;
  box-sizing: border-box;
  color: rgba(17, 17, 17, 0.18);
  background: transparent;
  transform: translateY(-2px);
}

.month-index-track {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

.month-index-year-switcher {
  position: absolute;
  right: 0;
  bottom: calc(100% + 3px);
  display: flex;
  gap: 8px;
  font: 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.month-index-year {
  color: rgba(17, 17, 17, 0.38);
  text-decoration: none;
}

.month-index-year.is-current {
  color: rgba(17, 17, 17, 0.72);
  font-weight: 650;
}

a.month-index-year:hover,
a.month-index-year:focus-visible {
  color: #111;
  outline: 0;
}

.month-index-month {
  position: relative;
  display: grid;
  place-items: center;
  height: 18px;
  border-radius: 1px;
  color: rgba(17, 17, 17, 0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.36rem;
  font-weight: 450;
  line-height: 1;
  text-decoration: none;
}

.month-index-month::after {
  display: none;
  content: none;
}

.month-index-label {
  position: relative;
  z-index: 1;
}

.month-index-month.is-available {
  color: rgba(17, 17, 17, 0.46);
}

.month-index-month.is-current {
  color: rgba(17, 17, 17, 0.72);
}

.month-index-month.is-available:hover,
.month-index-month.is-available:focus-visible,
.month-index-month.is-current:hover,
.month-index-month.is-current:focus-visible {
  color: #111;
  outline: 0;
}

.month-index-canister {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 2px;
  color: rgba(17, 17, 17, 0.72);
  background: rgba(255, 212, 0, 0.54);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.28rem;
  font-weight: 620;
  line-height: 1;
  transform-origin: 50% 50%;
  transition: transform 140ms ease, filter 140ms ease;
}

.month-index-canister::before {
  position: absolute;
  top: -2px;
  right: -1px;
  left: -1px;
  height: 4px;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.68);
  box-shadow: 0 19px 0 rgba(17, 17, 17, 0.68);
  content: "";
}

.month-index-canister::after {
  position: absolute;
  top: -5px;
  left: 6px;
  width: 6px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: rgba(17, 17, 17, 0.68);
  content: "";
}

.month-index-canister > span {
  position: relative;
  z-index: 1;
}

.month-index-month:hover .month-index-canister,
.month-index-month:focus-visible .month-index-canister {
  filter: saturate(1.08);
  transform: scale(1.05);
}

@media (max-width: 760px) {
  .month-journal .month-sheet-heading:has(.month-index) {
    display: block;
    padding-bottom: 27px;
  }

  .month-journal .month-sheet-heading:has(.month-index) .month-title-copy {
    display: block;
  }

  .month-index {
    position: absolute;
    right: 3px;
    bottom: 5px;
    width: min(244px, 68%);
    height: 16px;
    padding: 0 5px;
    transform: none;
  }

  .month-index-year-switcher {
    bottom: calc(100% + 2px);
    font-size: 7px;
  }

  .month-index-month {
    height: 14px;
    font-size: 0.2rem;
  }

  .month-index-canister {
    transform: scale(0.82);
  }

  .month-index-month:hover .month-index-canister,
  .month-index-month:focus-visible .month-index-canister {
    transform: scale(0.88);
  }
}

/* Review index shares the same top rail as the month switcher. */
.month-journal .month-sheet-heading:has(.entry-shelf) {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) auto minmax(285px, 1.18fr);
  align-items: end;
  gap: clamp(20px, 3vw, 42px);
  width: 100%;
  margin-bottom: 17px;
  padding: 0 0 17px;
}

.month-journal .month-sheet-heading:has(.entry-shelf) .month-title-copy {
  min-width: 0;
}

.month-journal .month-sheet-heading:has(.entry-shelf) .month-title-copy h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.3vw, 2.65rem);
  font-family: ui-serif, "Songti SC", serif;
  font-weight: 860;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.entry-shelf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.5vw, 34px);
  width: auto;
  margin: 0;
  padding: 0 0 2px;
  white-space: nowrap;
}

.review-entry {
  display: flex;
  min-height: 24px;
  align-items: center;
  color: #827865;
  font: 500 13px/1 ui-serif, "Songti SC", serif;
  text-decoration: none;
}

.review-entry::after {
  display: none;
  content: none;
}

.review-entry:hover,
.review-entry:focus-visible {
  color: #29261f;
  outline: 0;
}

.review-entry[aria-disabled="true"] {
  color: #aca493;
  cursor: default;
}

.entry-word {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding-bottom: 7px;
}

.entry-word sup {
  color: #a29886;
  font: 500 7px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.print-mark {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  border-block: 1px solid rgba(119, 103, 62, 0.2);
  background: repeating-linear-gradient(90deg, #b6a66f 0 3px, transparent 3px 5px);
  opacity: 0.65;
}

.review-entry.is-pending .print-mark {
  border-block-color: rgba(117, 107, 87, 0.18);
  background: repeating-linear-gradient(135deg, transparent 0 3px, #bdb5a4 3px 4px, transparent 4px 7px);
  opacity: 0.42;
}

.month-journal .month-sheet-heading:has(.entry-shelf) .month-index {
  transform: translateY(-4px);
}

.preview-footer {
  margin: 24px auto 72px;
  color: #b0a793;
  font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

body.weather-page:has(.preview-footer) .weather-month-main {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .month-journal .month-sheet-heading:has(.entry-shelf) {
    grid-template-columns: auto 1fr;
    gap: 11px 18px;
    padding: 0 3px 10px;
  }

  .month-journal .month-sheet-heading:has(.entry-shelf) .month-title-copy h1 {
    font-size: 1.62rem;
  }

  .entry-shelf {
    justify-self: end;
    gap: 16px;
  }

  .review-entry {
    font-size: 10px;
  }

  .entry-word {
    padding-bottom: 5px;
  }

  .print-mark {
    height: 3px;
  }

  .month-journal .month-sheet-heading:has(.entry-shelf) .month-index {
    position: relative;
    right: auto;
    bottom: auto;
    grid-column: 1 / -1;
    width: 100%;
    height: 16px;
    padding: 0 2px;
    transform: none;
  }

  .preview-footer {
    margin-bottom: 75px;
  }
}
