.story-index {
  max-width: 62rem;
  padding-block: clamp(.9rem, 2.3vw, 1.7rem) 2.8rem;
}
.story-index [hidden] { display: none !important; }
.story-index .crumb { margin: 0 0 .65rem; }
.story-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1.15rem;
}
.story-heading h1 {
  font-size: clamp(2.25rem, 5vw, 3.8rem);
  letter-spacing: -.035em;
}
#story-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: .45rem .75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}
#story-toggle:hover, #story-toggle[aria-expanded="true"] { border-color: var(--berry); }
.story-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.chapter-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .3rem;
  min-width: 0;
  margin: 0;
  padding: .3rem;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: #f1e9e1;
}
.chapter-picker label { position: relative; min-width: 0; cursor: pointer; }
.chapter-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.chapter-picker label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25em;
  min-height: 44px;
  padding: .25rem;
  border-radius: 5px;
  font-weight: 650;
  white-space: nowrap;
}
.chapter-picker label:hover > span { background: var(--white); }
.chapter-picker input:checked + span { background: var(--berry); color: #fff; }
.chapter-picker input:focus-visible + span { outline: 3px solid #b54266; outline-offset: 1px; }
.chapter-short { display: none; }
.chapter-panel { min-width: 0; scroll-margin-top: .8rem; }
.chapter-panel > summary, .story-help summary {
  padding: .85rem 0;
  cursor: pointer;
  font-weight: 700;
  color: var(--berry);
}
.has-picker .chapter-panel > summary { display: none; }
.chapter-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  padding: 1.15rem 0 .75rem;
  border-bottom: 2px solid var(--ink);
}
.chapter-caption h2 { font-size: clamp(1.65rem, 3.5vw, 2.4rem); }
.chapter-caption > span, .mission-copy small { color: var(--quiet); font-size: .89rem; }
.mission-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: transparent;
}
.mission-table td, .mission-table tbody th {
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}
.mission-table td {
  width: 3.6rem;
  padding-right: .5rem;
  text-align: center;
  color: var(--quiet);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.mission-table th > a, .mission-table th > .mission-copy {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: .5rem .6rem .5rem 0;
}
.mission-table th > .mission-copy { align-items: start; justify-content: center; flex-direction: column; }
.mission-table th > a { justify-content: space-between; gap: .75rem; color: var(--berry); text-decoration: none; }
.mission-table th > a:hover .mission-name, .mission-table th > a:focus-visible .mission-name { text-decoration: underline; }
.mission-table tr:has(a:hover) { background: #f5ede7; }
.mission-table th i { width: .48rem; height: .48rem; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.mission-name { font-weight: 650; }
.mission-copy small { display: block; line-height: 1.4; font-weight: 400; }
.mission-table tr:target { background: #fae6d9; outline: 2px solid #98506d; outline-offset: -2px; }
.story-help { margin-top: 1.75rem; border-top: 1px solid var(--rule); }
.story-help > details { border-bottom: 1px solid var(--rule); }
.story-help > details[open] { padding-bottom: .75rem; }
.story-help summary:focus-visible, .chapter-panel summary:focus-visible { outline: 2px solid #98506d; }
.story-help .artsec { margin: .4rem 0 1.25rem; padding-top: .5rem; border-top: none; }
.story-help ul { padding-left: 1.25rem; }
.story-help li { margin: .45rem 0; }
.mission-finder {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--white);
}
.story-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; }
.story-fields label { min-width: 0; font-size: .9rem; font-weight: 650; }
.story-fields :is(input,select) {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: .25rem;
  padding: .5rem .65rem;
  border: 1px solid #9b8c91;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  font-size: 1rem;
}
.mission-finder p:not(:empty) { margin-top: .75rem; font-size: .92rem; }
.mission-finder ul { list-style: none; padding: 0; margin: 0; }
.mission-finder li { padding: .65rem 0; border-bottom: 1px solid var(--rule); }
.mission-finder li a { display: inline-block; padding-block: .2rem; font-weight: 700; }
.mission-finder li span { display: block; color: var(--quiet); font-size: .9rem; }
@media (max-width: 600px) {
  .story-index { padding-inline: 1rem; }
  .story-index .crumb { display: none; }
  .story-heading { align-items: center; margin-bottom: .8rem; }
  .story-heading h1 { font-size: clamp(2rem, 7.2vw, 2.45rem); line-height: .98; }
  #story-toggle { padding-inline: .56rem; }
  .chapter-picker { gap: .12rem; padding: .2rem; }
  .chapter-short { display: inline; }
  .chapter-long { display: none; }
  .chapter-caption { padding-top: .85rem; }
  .mission-table td { width: 3rem; }
}
@media (max-width: 440px) { .story-fields { grid-template-columns: 1fr; } }

@media (max-width: 360px) {
  #story-toggle { width: 44px; }
  #story-toggle .story-search-label { display: none; }
}
