.hjtp .hjtp-browse-content {
  min-width: 0;
}

.hjtp .hjtp-browse-content .hjtp-shell {
  width: 100%;
}

.hjtp .hjtp-browse-content .hjtp-explore {
  background: transparent;
  border-top: 1px solid var(--hjtp-line);
  border-bottom: 1px solid var(--hjtp-line);
}

.hjtp .hjtp-browse-content .hjtp-card-actions,
.hjtp .hjtp-browse-content .hjtp-venue-actions {
  flex-wrap: wrap;
}

.hjtp .hjtp-browse-content .hjtp-save,
.hjtp .hjtp-browse-content .hjtp-detail-link {
  min-height: 44px;
}

.hjtp a.hjtp-detail-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.hjtp .hjtp-venue .hjtp-detail-link {
  color: #fff !important;
}

.hjtp .hjtp-venue .hjtp-detail-link:hover {
  color: #e7c7a7 !important;
}

.hjtp .hjtp-browse-content .hjtp-card-meta {
  margin-bottom: 14px;
}

.hjtp .hjtp-paper {
  --hjtp-paper: #fbf7ed;
  --hjtp-paper-rule: #ded3c0;
  position: relative;
  display: none;
  flex-direction: column;
  min-height: 345px;
  padding: 24px 26px 22px;
  background: var(--hjtp-paper);
  border: 1px solid var(--hjtp-paper-rule);
  border-top: 3px double var(--hjtp-rust);
  box-shadow: 0 14px 30px rgba(54, 42, 30, .12), 0 2px 4px rgba(54, 42, 30, .06);
}

.hjtp .hjtp-paper-heading {
  position: relative;
  padding: 5px 0 19px;
  border-bottom: 1px solid var(--hjtp-paper-rule);
}

.hjtp .hjtp-paper-heading .hjtp-overline {
  color: var(--hjtp-rust);
  font-size: 9px;
  letter-spacing: .17em;
}

.hjtp #hjtp-paper-title {
  margin-top: 10px;
  color: #563726;
  font: italic 400 2.65rem/1.1 'Libre Baskerville', Georgia, serif;
}

.hjtp .hjtp-paper-sheet {
  min-height: 128px;
  padding: 14px 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.hjtp #hjtp-paper-empty {
  min-height: 96px;
  color: #635447;
  background: repeating-linear-gradient(transparent 0 31px, var(--hjtp-paper-rule) 31px 32px);
  font: 15px/32px Georgia, serif;
}

.hjtp #hjtp-paper-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hjtp #hjtp-paper-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--hjtp-paper-rule);
  color: #3d342a;
  font: 16px/1.35 Georgia, serif;
  overflow-wrap: anywhere;
}

.hjtp #hjtp-paper-items button {
  min-height: 44px;
  padding: 4px;
  border: 0;
  background: none;
}

.hjtp #hjtp-paper-items [data-detail] {
  min-width: 0;
  padding-inline-start: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  overflow-wrap: anywhere;
}

.hjtp #hjtp-paper-items [data-detail]:hover {
  text-decoration: underline;
}

.hjtp #hjtp-paper-items .hjtp-paper-remove {
  flex: 0 0 auto;
  width: 44px;
  color: var(--hjtp-rust);
  font: 20px/1 Arial, sans-serif;
}

.hjtp .hjtp-paper-actions {
  display: grid;
  justify-items: stretch;
  gap: 5px;
  margin-top: auto;
  padding-top: 13px;
}

.hjtp #hjtp-paper-share {
  min-height: 44px;
  gap: 8px;
  padding: 10px 12px;
  font-size: 10px !important;
}

.hjtp .hjtp-paper-actions a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--hjtp-rust);
  font-size: 13px;
  text-decoration: underline;
}

.hjtp .hjtp-paper-close {
  display: none;
}

.hjtp .hjtp-paper-dialog {
  width: min(100%, 420px);
  max-width: none;
  max-height: min(84vh, 720px);
  max-height: min(84dvh, 720px);
  margin: auto 0 0 auto;
  padding: 0;
  overflow: auto;
  border: 0;
  background: transparent;
  color: var(--hjtp-ink);
}

.hjtp .hjtp-paper-dialog::backdrop {
  background: rgba(13, 23, 28, .68);
}

.hjtp .hjtp-paper-dialog[open] .hjtp-paper {
  display: flex;
  max-height: min(84vh, 720px);
  max-height: min(84dvh, 720px);
  min-height: 0;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.hjtp .hjtp-paper-dialog[open] .hjtp-paper-close {
  display: block;
  width: 44px;
  height: 44px;
  top: 0;
  right: 0;
}

.hjtp .hjtp-paper-dialog .hjtp-paper-sheet {
  min-height: 0;
}

.hjtp [data-open-paper].hjtp-floating {
  left: auto;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: auto;
  min-height: 48px;
}

.hjtp #hjtp-detail-modal {
  width: min(1180px, calc(100% - 64px));
  height: min(880px, calc(100vh - 60px));
  height: min(880px, calc(100dvh - 60px));
  max-height: none;
  margin: auto;
  overflow: hidden;
  grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr);
}

.hjtp #hjtp-detail-modal[open] {
  display: grid;
}

.hjtp .hjtp-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 5px 22px;
  border-bottom: 1px solid var(--hjtp-line);
  background: var(--hjtp-cream);
}

.hjtp .hjtp-detail-top .hjtp-overline {
  color: var(--hjtp-rust);
  font-size: 10px;
}

.hjtp .hjtp-detail-back {
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--hjtp-ink);
  font-size: 13px;
  font-weight: 700;
}

.hjtp .hjtp-detail-back span {
  margin-right: 5px;
  color: var(--hjtp-rust);
}

.hjtp .hjtp-detail-reader {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  overflow: auto;
  overscroll-behavior: contain;
}

.hjtp .hjtp-detail-reader .hjtp-modal-image {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(min(880px, 100vh - 60px) - 125px);
  height: calc(min(880px, 100dvh - 60px) - 125px);
  min-height: 0;
}

.hjtp .hjtp-detail-reader .hjtp-modal-content {
  width: min(100%, 740px);
  padding: clamp(25px, 4vw, 58px);
}

.hjtp #hjtp-detail-modal h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.hjtp #hjtp-detail-modal .hjtp-modal-actions {
  justify-content: end;
  margin: 0;
  padding: 12px 22px;
  border-top: 1px solid var(--hjtp-line);
  background: var(--hjtp-cream);
}

.hjtp #hjtp-detail-save {
  min-height: 46px;
  padding-inline: 20px !important;
}

.hjtp #hjtp-detail-story {
  margin: 24px 0;
}

.hjtp #hjtp-detail-story h3 {
  margin: 22px 0 6px;
}

.hjtp #hjtp-detail-story p,
.hjtp #hjtp-detail-story li {
  color: #546067;
  font-size: 15px;
  line-height: 1.7;
}

.hjtp #hjtp-detail-story blockquote {
  margin: 0;
  padding: 16px 20px;
  border-left: 2px solid var(--hjtp-rust);
  background: var(--hjtp-cream);
}

@media (min-width: 1120px) {
  .hjtp .hjtp-browse-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 22%);
    gap: clamp(24px, 3vw, 42px);
  }

  .hjtp .hjtp-browse-layout > .hjtp-paper {
    position: sticky;
    top: 26px;
    align-self: start;
    display: flex;
    max-height: calc(100vh - 52px);
    max-height: calc(100dvh - 52px);
    margin-top: 92px;
  }

  .hjtp .hjtp-browse-layout > .hjtp-paper[data-paper-pinned] {
    position: fixed;
    z-index: 10;
    inset: var(--hjtp-paper-top) auto auto var(--hjtp-paper-left);
    width: var(--hjtp-paper-width);
    max-height: calc(100dvh - max(24px, var(--hjtp-paper-top)) - 24px);
    margin-top: 0;
  }

  .hjtp .hjtp-browse-content .hjtp-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hjtp [data-open-paper].hjtp-floating {
    display: none;
  }
}

@media (min-width: 1120px) and (max-width: 1439px) {
  .hjtp .hjtp-browse-content .hjtp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hjtp .hjtp-browse-content .hjtp-venue-content {
    padding-inline: 18px;
  }
}

@media (max-width: 760px) {
  .hjtp #hjtp-detail-modal {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
  }

  .hjtp .hjtp-detail-reader {
    display: block;
  }

  .hjtp .hjtp-detail-reader .hjtp-modal-image {
    position: static;
    height: clamp(150px, 30vh, 280px);
  }

  .hjtp .hjtp-detail-top {
    padding-inline: 17px;
  }

  .hjtp .hjtp-detail-top .hjtp-overline {
    display: none;
  }

  .hjtp #hjtp-detail-modal .hjtp-modal-actions {
    justify-content: stretch;
    padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  }

  .hjtp #hjtp-detail-save {
    width: 100%;
  }
}
