.archive-page {
  min-width: 1500px;
}

.archive-page .browser-window {
  width: 1680px;
}

.archive-page .page {
  width: 1560px;
}

.page--archive .sidebar {
  min-height: 1120px;
}

.archive-main {
  align-content: start;
}

.app-view {
  display: block;
}

.app-view > * + * {
  margin-top: 14px;
}

.app-view[hidden] {
  display: none;
}

.archive-banner {
  height: 208px;
  position: relative;
  overflow: hidden;
  background: #d8e7c9;
  border-radius: 5px;
  box-shadow: 0 3px 6px var(--shadow);
}

.archive-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  filter: saturate(1.05);
}

.archive-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(56, 32, 11, .58), transparent 48%),
    linear-gradient(0deg, rgba(87, 45, 15, .22), transparent 42%);
  pointer-events: none;
}

.archive-banner__sign {
  width: 398px;
  height: 174px;
  position: absolute;
  right: 92px;
  top: 13px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 52px 32px;
  color: #fff0c0;
  text-align: center;
  background: url("assets/wood-board.png") center / contain no-repeat;
  filter: drop-shadow(0 7px 7px rgba(43, 23, 6, .38));
}

.archive-banner__sign p {
  color: #fff4d2;
  font-family: "Kalam", cursive;
  font-size: 30px;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(91, 44, 14, .95),
    0 0 5px rgba(72, 34, 12, .55);
}

.archive-banner__sign h1 {
  margin-top: 6px;
  color: #ffedbc;
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(92, 43, 13, 1),
    2px 3px 0 rgba(67, 28, 7, .7),
    0 0 5px rgba(49, 22, 7, .62);
}

.archive-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.archive-stats article {
  min-height: 82px;
  display: grid;
  grid-template-columns: 43px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  color: #3a2413;
  background:
    repeating-linear-gradient(0deg, rgba(133, 84, 33, .045) 0 1px, transparent 1px 7px),
    linear-gradient(#fff4d4, #edcf93);
  border: 2px solid #b97836;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .6),
    0 2px 4px rgba(73, 42, 13, .2);
}

.archive-stats article::after {
  content: "❧";
  position: absolute;
  right: 22px;
  top: 13px;
  color: rgba(96, 114, 53, .13);
  font-family: "IM Fell English", Georgia, serif;
  font-size: 32px;
  line-height: 1;
  transform: rotate(16deg);
}

.archive-stats__icon {
  width: 43px;
  height: 43px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  color: #fff1c9;
  font-family: Georgia, serif;
  font-size: 24px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 235, 180, .25), transparent 46%),
    linear-gradient(#ba4a28, #823019);
  border: 2px solid #64230f;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 244, 209, .35);
}

.archive-stats strong {
  color: #8a2d19;
  font-family: "Rye", Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.archive-stats span:last-child {
  align-self: start;
  color: #5e3a1d;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 16px;
}

.archive-workspace {
  display: grid;
  grid-template-columns: 246px 1fr;
  gap: 14px;
  align-items: start;
}

.reader-view[hidden] {
  display: none;
}

.reader-view {
  --reader-font-size: 18px;
  --reader-line-height: 1.42;
  --reader-measure: 100%;
  --reader-font-family: "Special Elite", "Courier New", monospace;
  padding: 12px;
  background:
    radial-gradient(circle at 93% 26%, rgba(176, 61, 31, .32) 0 4px, transparent 5px),
    radial-gradient(circle at 4% 67%, rgba(176, 61, 31, .28) 0 4px, transparent 5px),
    linear-gradient(180deg, rgba(145, 169, 93, .78), rgba(205, 167, 88, .86));
  border: 2px solid rgba(158, 99, 41, .58);
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(255, 241, 200, .24);
}

.reader-toolbar {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: #fff1c9;
  background:
    repeating-linear-gradient(90deg, rgba(255, 221, 156, .1) 0 1px, transparent 1px 9px),
    linear-gradient(#825020, #5a3010);
  border: 2px solid #3e1f0b;
  border-top-color: #b97836;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 221, 156, .15),
    0 2px 5px rgba(73, 42, 13, .2);
}

.reader-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 17px;
}

.reader-breadcrumb strong {
  max-width: 560px;
  overflow: hidden;
  color: #fff7dd;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.reader-toolbar__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.reader-exit-focus {
  display: none;
}

.reader-focus-options {
  display: none;
}

.reader-view.reader-mode-focus .reader-exit-focus,
.reader-view.reader-mode-focus .reader-focus-options {
  display: inline-flex;
  align-items: center;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.reader-paper {
  min-height: 720px;
  position: relative;
  padding: 42px 55px 46px;
  color: #3d2612;
  background:
    radial-gradient(circle at 13% 18%, rgba(130, 79, 33, .12) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 76%, rgba(130, 79, 33, .1) 0 1px, transparent 2px),
    linear-gradient(90deg, rgba(121, 69, 26, .16), transparent 28px, transparent calc(100% - 28px), rgba(121, 69, 26, .14)),
    linear-gradient(#fff8df, #f4dfac);
  border: 2px solid #8d5828;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 6px rgba(255, 251, 231, .35),
    inset 0 0 22px rgba(132, 80, 32, .18),
    0 5px 8px rgba(73, 42, 13, .24);
}

.reader-paper::before,
.reader-paper::after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  border: 10px solid rgba(104, 59, 23, .42);
  pointer-events: none;
}

.reader-paper::before {
  left: 10px;
  top: 10px;
  border-right: 0;
  border-bottom: 0;
}

.reader-paper::after {
  right: 10px;
  bottom: 10px;
  border-left: 0;
  border-top: 0;
}

.reader-paper__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(165, 99, 37, .58);
}

.reader-paper__head h2 {
  color: #4b2a13;
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.08;
  text-shadow: 0 1px 0 #fff2c7;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 9px;
  color: #68411e;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 16px;
}

.reader-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.reader-source {
  text-decoration: none;
}

.reader-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.reader-story-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 18px 0 16px;
  color: var(--apple);
}

.reader-story-nav--bottom {
  margin: 22px 0 0;
}

.reader-story-nav span {
  overflow: hidden;
  text-align: center;
}

.reader-story-nav span::before,
.reader-story-nav span::after {
  content: "";
  display: inline-block;
  width: 40%;
  margin: 0 12px 4px;
  border-top: 1px dashed rgba(165, 99, 37, .58);
}

.reader-text {
  max-width: var(--reader-measure);
  margin: 0 auto;
  color: #3d2612;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--reader-font-family);
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.reader-greentext-line {
  color: #35551f;
}

.reader-view.reader-mode-cozy .reader-paper {
  margin: 0 auto;
  padding: 46px 64px 52px;
  background:
    linear-gradient(#fff9ed, #f6ead4);
  border-color: #d1a56b;
  box-shadow:
    inset 0 0 0 3px rgba(255, 252, 236, .75),
    0 3px 7px rgba(73, 42, 13, .16);
}

.reader-view.reader-mode-cozy .reader-paper::before,
.reader-view.reader-mode-cozy .reader-paper::after {
  display: none;
}

.reader-view.reader-mode-cozy .reader-paper__head {
  border-bottom-color: rgba(165, 99, 37, .32);
}

.reader-view.reader-mode-cozy .reader-paper__head h2 {
  color: #5a3518;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 34px;
}

.reader-view.reader-mode-cozy .reader-story-nav span::before,
.reader-view.reader-mode-cozy .reader-story-nav span::after {
  border-top-color: rgba(165, 99, 37, .32);
}

.reader-view.reader-mode-cozy .reader-text {
  max-width: min(var(--reader-measure), 78ch);
  color: #2f2115;
  font-size: calc(var(--reader-font-size) + 1px);
  line-height: max(var(--reader-line-height), 1.62);
}

.reader-view.reader-mode-cozy .reader-greentext-line {
  color: #41642b;
}

.reader-view.reader-mode-focus .reader-layout {
  grid-template-columns: minmax(0, 1fr);
}

.reader-view.reader-mode-focus .reader-side {
  display: block;
}

.reader-view.reader-mode-focus .reader-side-panel {
  display: none;
}

.reader-view.reader-mode-focus.reader-options-open .reader-options-panel {
  display: block;
  width: 260px;
  position: absolute;
  right: 0;
  top: 58px;
  z-index: 20;
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 222, .72),
    0 6px 16px rgba(73, 42, 13, .24);
}

.reader-view.reader-mode-focus .reader-text {
  max-width: min(var(--reader-measure), 82ch);
  font-size: calc(var(--reader-font-size) + 2px);
  line-height: max(var(--reader-line-height), 1.55);
}

.reader-side {
  display: grid;
  gap: 12px;
}

.reader-side-panel .panel__head {
  min-height: 36px;
  padding-top: 7px;
  color: #fff6cf;
  background:
    repeating-linear-gradient(90deg, rgba(25, 50, 16, .14) 0 2px, transparent 2px 7px),
    linear-gradient(#879a4f, #697d39);
  border-bottom: 2px solid #5c6e31;
}

.reader-side-panel .panel__head h2 {
  color: #fff6cf;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 22px;
  text-shadow: 0 1px 0 rgba(43, 58, 22, .8);
}

.reader-info {
  display: grid;
  gap: 8px;
  font-size: 15px;
}

.reader-info strong {
  color: #8d301e;
}

.reader-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.reader-mode {
  min-height: 58px;
  padding: 7px 5px;
  color: #6c3018;
  cursor: pointer;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 15px;
  background: linear-gradient(#fff3ce, #edcf8e);
  border: 2px solid #c18a45;
  border-radius: 5px;
}

.reader-mode:hover,
.reader-mode--active {
  color: #5b210f;
  background: linear-gradient(#fff8df, #e9c371);
  box-shadow: inset 0 0 0 2px rgba(255, 248, 222, .62);
}

.reader-options {
  display: grid;
  gap: 10px;
}

.reader-options label {
  display: grid;
  gap: 5px;
}

.reader-options span {
  color: #6f2c16;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 15px;
}

.reader-options input,
.reader-options select {
  width: 100%;
}

.reader-options select {
  height: 32px;
  padding: 5px 8px;
  color: #2f2115;
  font: 14px "Special Elite", monospace;
  background: #fff9e9;
  border: 2px inset #c7ad78;
  border-radius: 3px;
}

.reader-review p {
  color: #6f2e19;
  font-family: "Kalam", cursive;
  font-size: 17px;
  line-height: 1.28;
}

.reader-related {
  display: grid;
  gap: 8px;
}

.related-story-button {
  min-height: 32px;
  padding: 5px 7px;
  color: #7d2f19;
  cursor: pointer;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 15px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(165, 99, 37, .58);
}

.related-story-button:hover {
  color: #9f321f;
  background: rgba(188, 65, 39, .08);
}

.archive-filters {
  position: sticky;
  top: 10px;
}

.archive-filters .panel__body {
  display: grid;
  gap: 10px;
  padding: 10px 14px 17px;
}

.filter-field {
  display: grid;
  gap: 4px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 8px;
}

.filter-field span {
  color: #6f2c16;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 15px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  height: 34px;
  padding: 5px 8px;
  color: #2f2115;
  font: 14px "Special Elite", monospace;
  background: #fff9e9;
  border: 2px inset #c7ad78;
  border-radius: 3px;
  box-shadow: inset 0 2px 4px rgba(99, 67, 26, .14);
}

.archive-button {
  min-height: 33px;
  padding: 6px 11px 5px;
  color: #fff5d4;
  cursor: pointer;
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 13px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 175, .12) 0 1px, transparent 1px 7px),
    linear-gradient(#9d5d2b, #6c3915);
  border: 2px solid #4e260d;
  border-radius: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 181, .3),
    0 2px 0 rgba(50, 23, 6, .45);
}

.archive-button:hover {
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 175, .16) 0 1px, transparent 1px 7px),
    linear-gradient(#b66e34, #793f18);
}

.archive-button:disabled {
  color: #a2784a;
  cursor: default;
  background: linear-gradient(#d9bd82, #b88b56);
  border-color: #8f6638;
  box-shadow: none;
}

.archive-button--full {
  width: 100%;
}

.mini-panel {
  margin-top: 4px;
  padding: 9px;
  background:
    repeating-linear-gradient(0deg, rgba(133, 84, 33, .07) 0 1px, transparent 1px 6px),
    linear-gradient(#fff1c8, #e9ca8a);
  border: 2px dashed #a76a2d;
  border-radius: 4px;
}

.mini-panel h3 {
  margin-bottom: 8px;
  color: #8d301e;
  font-family: "Rye", Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(165, 99, 37, .5);
}

.tag-pagination .archive-button {
  min-height: 25px;
  padding: 2px 8px 1px;
  font-size: 12px;
}

.tag-pagination span {
  min-width: 58px;
  color: #5d381b;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  text-align: center;
}

.tag-cloud button,
.genre-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin: 0;
  padding: 3px 7px 2px;
  color: #592511;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 13px;
  line-height: 1;
  background:
    radial-gradient(circle at 12% 50%, rgba(173, 56, 31, .22) 0 2px, transparent 3px),
    linear-gradient(#f6dfa8, #dcae66);
  border: 1px dashed rgba(123, 66, 25, .86);
  border-radius: 3px;
}

.tag-cloud button,
.genre-chip {
  cursor: pointer;
}

.tag-cloud button:hover,
.genre-chip:hover {
  color: #8c2c19;
  background: linear-gradient(#ffe5ad, #e8bd72);
}

.archive-list-zone {
  min-width: 0;
}

.archive-list-panel {
  min-height: 690px;
}

.archive-list-head {
  align-items: baseline;
  flex-wrap: wrap;
}

.archive-list-head h2 {
  flex: 1;
}

.result-count {
  margin-left: auto;
  color: #6d431f;
  font-family: "Special Elite", monospace;
  font-size: 14px;
}

.archive-list-body {
  padding: 10px 16px 17px;
}

.archive-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.story-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 11px;
  padding: 10px 11px 11px;
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(133, 84, 33, .04) 0 1px, transparent 1px 8px),
    linear-gradient(#fff7dd, #f1d9a5);
  border: 2px solid #c18a45;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 251, 232, .72),
    0 1px 3px rgba(76, 42, 12, .16);
}

.story-card::after {
  content: "🍎";
  position: absolute;
  right: 14px;
  top: 16px;
  color: rgba(159, 50, 31, .1);
  font-size: 28px;
  line-height: 1;
  opacity: .16;
  transform: rotate(-13deg);
}

.story-card__rank {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff4cf;
  font-family: "Rye", Georgia, serif;
  font-size: 16px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 236, 185, .25), transparent 46%),
    linear-gradient(#b54324, #742813);
  border: 2px solid #5a1e0d;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 243, 208, .38);
}

.story-card__topline {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: start;
}

.story-card h3 {
  color: #8d301e;
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.16;
}

.story-title-button {
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.story-title-button:hover {
  color: #bd4127;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.story-card__meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  margin-top: 4px;
  color: #67411f;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 15px;
}

.content-badge {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px 1px;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 12px;
  line-height: 1;
  border-radius: 3px;
}

.content-badge--sfw {
  color: #4d5b24;
  background: #e5edbd;
  border: 1px solid rgba(89, 107, 45, .58);
}

.content-badge--nsfw {
  color: #8d2f1c;
  background: #f2d0a5;
  border: 1px solid rgba(151, 69, 35, .62);
}

.rating-badge {
  position: relative;
  z-index: 1;
  min-width: 78px;
  padding: 4px 7px 3px;
  color: #7c2c18;
  text-align: center;
  white-space: nowrap;
  background: #fff1c8;
  border: 1px solid #b97836;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 228, .7);
}

.story-card__summary {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #2f2115;
  font-size: 14px;
}

.story-card__note {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  padding-left: 10px;
  color: #6f2e19;
  font-family: "Kalam", cursive;
  font-size: 16px;
  line-height: 1.24;
  border-left: 3px solid var(--apple);
}

.story-card__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.source-link {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px 2px;
  color: #fff5d4;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  text-decoration: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 175, .12) 0 1px, transparent 1px 7px),
    linear-gradient(#879a4f, #5f7134);
  border: 2px solid #53612d;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 220, .24);
}

.source-link:hover {
  color: #fff9dc;
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 175, .15) 0 1px, transparent 1px 7px),
    linear-gradient(#97aa5b, #697d39);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(165, 99, 37, .5);
}

.pagination--top {
  gap: 7px;
  margin: 0 0 0 8px;
  padding: 0;
  border-top: 0;
}

.pagination--top .archive-button {
  min-height: 25px;
  padding: 2px 8px 1px;
  font-size: 12px;
}

.pagination span {
  min-width: 118px;
  color: #5d381b;
  font-family: "Special Elite", monospace;
  font-size: 14px;
  text-align: center;
}

.pagination--top span {
  min-width: 82px;
  font-size: 12px;
}

.archive-empty {
  padding: 34px 14px;
  color: #6f2e19;
  font-family: "Kalam", cursive;
  font-size: 22px;
  text-align: center;
}
