body[data-mw4-guide] .layout-shell {
  max-width: 1280px;
  margin-top: 0;
}

body[data-mw4-guide] .main-content {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
  padding-bottom: 28px;
}

body[data-mw4-guide] .site-intro {
  margin-top: 0;
  padding-top: 0;
}

@media (min-width: 851px) {
  body[data-mw4-guide] .page-affiliate-note { display: none; }
}

body[data-mw4-guide] .site-intro .subpage-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  line-height: 1.2;
  text-align: left;
  color: var(--accent);
}

[data-mw4-guide] .site-intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 8px;
}

[data-mw4-guide] .site-intro-links {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

[data-mw4-guide] .site-intro-top .subpage-back-link {
  margin: 0;
}

[data-mw4-guide] .site-intro-top .page-updated-at {
  position: static;
  flex: 0 0 auto;
  text-align: right;
}

@media (max-width: 600px) {
  body[data-mw4-guide] .layout-shell {
    margin-top: 0;
  }

  body[data-mw4-guide] .main-content {
    padding: 6px 8px 8px;
  }

  body[data-mw4-guide] .layout-shell,
  body[data-mw4-guide] .main-content,
  body[data-mw4-guide] .panel,
  body[data-mw4-guide] .mobile-ad-slot,
  body[data-mw4-guide] .sp-ad-viewport,
  body[data-mw4-guide] .sp-ad-card,
  body[data-mw4-guide] .character-list,
  body[data-mw4-guide] .character-card {
    max-width: 100%;
    min-width: 0;
  }

  body[data-mw4-guide] .site-intro {
    margin-top: 0;
    padding-top: 0;
  }

  [data-mw4-guide] .site-intro-top {
    align-items: flex-start;
    margin-bottom: 6px;
  }

  [data-mw4-guide] .site-intro-links {
    gap: 6px;
  }
}

[data-mw4-guide] .subpage-title span {
  display: block;
}

[data-mw4-guide] .guide-work-name {
  color: inherit;
  font-size: .72em;
  margin-bottom: .35rem;
}

.guide-panel h2,
.guide-panel h3 {
  scroll-margin-top: 1rem;
}

.guide-panel h3 {
  margin-block: 1rem .4rem;
}

.guide-panel li + li {
  margin-top: .35rem;
}

.guide-panel p,
.guide-panel li,
.guide-panel td {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.guide-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-nav a {
  align-content: center;
  display: inline-block;
  min-height: 2rem;
}

.guide-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
}

.guide-controls label {
  display: grid;
  flex: 1 1 12rem;
  gap: .15rem;
  min-width: 0;
}

.guide-controls .character-search,
.guide-controls .character-filter-select {
  min-height: 2.5rem;
  width: 100%;
}

.guide-controls .guide-reset {
  justify-content: center;
  min-height: 2.5rem;
  padding-inline: .65rem;
  width: auto;
}

.guide-table-wrap {
  margin-block: .6rem;
}

.guide-table.character-table {
  table-layout: auto;
}

.guide-table-wrap:not(.guide-compare) .guide-table.character-table {
  min-width: 0;
}

.guide-table.character-table :is(th, td):nth-child(n) {
  vertical-align: top;
  width: auto;
}

.guide-table.character-table thead th {
  padding: .4rem .55rem;
}

.guide-table .guide-short-heading,
.guide-compare .character-sort-button {
  white-space: nowrap;
}

.guide-table :is(th, td):first-child {
  font-weight: 700;
}

.guide-table.character-table tbody td:not(:first-child) {
  font-weight: 400;
}

@media (min-width: 851px) {
  .guide-table thead tr:has(th:nth-child(2):last-child) th:first-child {
    min-width: 8.5rem;
  }

  #story-missions .guide-table th:nth-child(2) {
    min-width: 8rem;
  }

  #modes .guide-table td:nth-child(2) {
    white-space: nowrap;
  }

  #modes .guide-table th:first-child {
    min-width: 8.5rem;
  }
}

.guide-scroll-hint {
  display: none;
}

.guide-compare {
  max-width: 100%;
  overflow-x: auto;
}

.guide-compare .guide-table {
  min-width: 34rem;
}

.guide-table caption {
  text-align: left;
}

[data-mw4-guide] :is(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 850px) {
  .guide-scroll-hint {
    display: block;
    margin: .5rem 0 0;
    font-size: .875rem;
  }

  .guide-compare .guide-table.character-table {
    table-layout: fixed;
  }

  .guide-compare .guide-table :is(th, td):first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 7.5rem;
    max-width: 7.5rem;
    background: var(--paper-color);
    border-right: 1px solid var(--rule-line);
  }

  .guide-compare .guide-table th:first-child {
    background: #e9efdd;
  }

  .guide-compare .guide-table th:nth-child(4) {
    width: 8.5rem;
  }

  .guide-compare .guide-table th:nth-child(5) {
    width: 5rem;
  }

  .guide-compare .character-sort-button {
    padding-inline: 0;
  }

  .guide-table-wrap:not(.guide-compare) .guide-table,
  .guide-table-wrap:not(.guide-compare) .guide-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .guide-table-wrap:not(.guide-compare) .guide-table tbody tr {
    display: grid;
    gap: .28rem;
    padding: .55rem .45rem;
    border-bottom: 1px solid var(--rule-line);
  }

  .guide-table-wrap:not(.guide-compare) .guide-table thead {
    position: absolute;
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
  }

  .guide-table-wrap:not(.guide-compare) .guide-table td {
    display: block;
    border: 0;
    padding: 0;
  }

  .guide-table-wrap:not(.guide-compare) .guide-table td:not(:first-child)::before {
    color: inherit;
    content: attr(data-label) "　";
    font-weight: 700;
  }

  #story-missions .guide-table td:first-child::before {
    content: attr(data-label) "　";
  }
}

@media (min-width: 851px) and (max-width: 1050px) {
  :is(#story-missions, #modes) .guide-table,
  :is(#story-missions, #modes) .guide-table tbody {
    display: block;
  }

  :is(#story-missions, #modes) .guide-table thead {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  :is(#story-missions, #modes) .guide-table tbody tr {
    display: grid;
    gap: .25rem .75rem;
    padding: .55rem .45rem;
    border-bottom: 1px solid var(--rule-line);
  }

  :is(#story-missions, #modes) .guide-table td {
    display: block;
    border: 0;
    padding: 0;
  }

  #modes .guide-table tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #modes .guide-table td:nth-child(3) {
    grid-column: 1 / -1;
  }

  #story-missions .guide-table tbody tr {
    grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 2fr);
  }

  #story-missions .guide-table td:nth-child(2) {
    grid-column: 2 / -1;
    font-weight: 700;
  }

  #story-missions .guide-table td:nth-child(3) {
    grid-column: span 2;
  }

  #modes .guide-table td:not(:first-child)::before,
  #story-missions .guide-table td:not(:nth-child(2))::before {
    content: attr(data-label) "　";
    font-weight: 700;
  }
}

.guide-card {
  display: grid;
  gap: .25rem;
  padding: .65rem .75rem;
}

.guide-card .character-card-name-cell {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.guide-card .character-card-value {
  background: transparent;
  border-radius: 0;
  display: block;
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0;
  text-align: start;
}

.guide-card .character-card-value::before {
  content: attr(data-label) "　";
  font-weight: 700;
}

.guide-contents,
.guide-group {
  scroll-margin-top: 1rem;
}

.guide-contents a {
  font-weight: 700;
}

.guide-group-header {
  margin-bottom: .45rem;
}

.guide-group-header h2 {
  margin-bottom: .35rem;
}

.guide-group-header .guide-nav {
  margin-top: .35rem;
}

.guide-group .guide-panel > h3:first-child {
  margin-block-start: 0;
  color: var(--accent);
}

.guide-panel h4 {
  margin-block: 1rem .4rem;
  overflow-wrap: anywhere;
}
#characters .character-table {
  min-width: 0;
}

#characters .character-table th:first-child {
  width: 61%;
}

@media (min-width: 851px) and (max-width: 1100px) {
  #characters .character-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 850px) {
  #characters .character-mobile-list-head,
  #characters .character-card-summary--with-value {
    grid-template-columns: minmax(0, 1fr) clamp(6rem, 25vw, 10rem);
  }
}
