body[data-work="medarot-r"] .layout-shell {
  max-width: 1280px;
  margin-top: 12px;
}

body[data-work="medarot-r"] .main-content {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 12px;
  padding-bottom: 24px;
}

body[data-work="medarot-r"] .page-affiliate-note {
  display: none;
}

.work-home-description,
.work-list-description {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.work-home-description {
  text-align: center;
}

.work-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.work-home-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px 16px;
  border: 2px solid var(--brand-light);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9fc 0%, #fff 100%);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(244, 114, 182, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.work-home-card:hover,
.work-home-card:focus-visible {
  border-color: var(--brand);
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(244, 114, 182, 0.12);
}

.work-home-card-title {
  margin: 0;
  color: var(--accent);
  font-size: 1.18rem;
  line-height: 1.3;
}

.work-home-card-text,
.work-home-card-count {
  margin: 0;
  line-height: 1.5;
}

.work-home-card-text {
  color: var(--text-main);
  font-size: 0.94rem;
}

.work-home-card-count {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
}

.work-site-intro {
  margin-top: 0;
  padding-top: 0;
}

.work-site-intro .subpage-title {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1.25;
  text-align: left;
}

.work-site-intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 8px;
}

.work-site-intro-top .subpage-back-link,
.work-site-intro-top .page-updated-at {
  margin: 0;
}

.work-site-intro-top .page-updated-at {
  position: static;
  flex: 0 0 auto;
  text-align: right;
}

.work-filter-grid--characters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-filter-grid--medarots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-filter-grid--reference {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.work-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}

.work-result-count {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
}

.work-reset-button,
.work-sort-direction {
  min-height: 2.2rem;
  padding: 6px 12px;
  border: 1px solid var(--brand-light);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.work-reset-button:hover,
.work-reset-button:focus-visible,
.work-sort-direction:hover,
.work-sort-direction:focus-visible {
  border-color: var(--brand);
  outline: none;
  background: #fff0f7;
}

.work-mobile-sort {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.work-character-table {
  min-width: 760px;
}

.work-character-table th:nth-child(1),
.work-character-table td:nth-child(1) { width: 27%; }
.work-character-table th:nth-child(2),
.work-character-table td:nth-child(2) { width: 15%; }
.work-character-table th:nth-child(3),
.work-character-table td:nth-child(3) { width: 38%; }
.work-character-table th:nth-child(4),
.work-character-table td:nth-child(4) { width: 20%; }

.work-medarot-table {
  min-width: 850px;
}

.work-medarot-table th:nth-child(1),
.work-medarot-table td:nth-child(1) { width: 8%; }
.work-medarot-table th:nth-child(2),
.work-medarot-table td:nth-child(2) { width: 30%; }
.work-medarot-table th:nth-child(3),
.work-medarot-table td:nth-child(3) { width: 18%; }
.work-medarot-table th:nth-child(4),
.work-medarot-table td:nth-child(4) { width: 18%; }
.work-medarot-table th:nth-child(5),
.work-medarot-table td:nth-child(5) { width: 26%; }

.work-reference-table {
  min-width: 760px;
  table-layout: fixed;
}

.work-reference-table th,
.work-reference-table td {
  overflow-wrap: anywhere;
}

.work-reference-table th:nth-child(1),
.work-reference-table td:nth-child(1) { width: 22%; }
.work-reference-table th:nth-child(2),
.work-reference-table td:nth-child(2) { width: 16%; }
.work-reference-table th:nth-child(3),
.work-reference-table td:nth-child(3) { width: 18%; }
.work-reference-table th:nth-child(4),
.work-reference-table td:nth-child(4) { width: 18%; }
.work-reference-table th:nth-child(5),
.work-reference-table td:nth-child(5) { width: 26%; }

.work-table-heading {
  display: block;
  min-height: 2.55rem;
  padding: 8px 10px;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.55;
}

.work-list-value-empty {
  color: var(--text-muted);
  font-weight: 600;
}

.work-card-summary {
  grid-template-columns: minmax(0, 1fr) auto;
}

.work-card-summary--static {
  display: grid;
  cursor: default;
}

.work-card-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.work-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.work-card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff0f7;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.work-card-open-icon {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
}

.work-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-page-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.work-page-link {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--brand-light);
  border-radius: 12px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.work-page-link:hover,
.work-page-link:focus-visible {
  border-color: var(--brand);
  outline: none;
  background: #fff0f7;
}

@media (max-width: 850px) {
  body[data-work="medarot-r"] .page-affiliate-note {
    display: block;
  }

  body[data-work="medarot-r"] .layout-shell,
  body[data-work="medarot-r"] .main-content,
  body[data-work="medarot-r"] .panel,
  body[data-work="medarot-r"] .mobile-ad-slot,
  body[data-work="medarot-r"] .character-list,
  body[data-work="medarot-r"] .character-card {
    max-width: 100%;
    min-width: 0;
  }

  .work-mobile-sort {
    display: grid;
  }

  .work-filter-grid--characters,
  .work-filter-grid--medarots,
  .work-filter-grid--reference {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-card-summary {
    align-items: start;
  }

  .work-card-meta span {
    white-space: normal;
  }
}

@media (max-width: 600px) {
  body[data-work="medarot-r"] .main-content {
    padding: 6px 8px 8px;
  }

  .work-site-intro-top {
    align-items: flex-start;
    margin-bottom: 6px;
  }

  .work-list-description {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .work-home-grid,
  .work-page-links,
  .work-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-home-card {
    padding: 14px 12px;
  }

  .work-home-card-title {
    font-size: 1.08rem;
  }

  .work-list-toolbar {
    align-items: flex-start;
  }
}
