/* V7: compact, mobile-first tool layout with no forced result-table scrolling. */
:root {
  --v7-pink: #f34da7;
  --v7-pink-dark: #7f184f;
  --v7-line: #dbc7d2;
  --v7-soft: #fff3f9;
  --v7-text: #28151f;
}

/* Remove project-internal explanatory copy from visitor-facing pages. */
.suite-page .suite-hero {
  margin: 8px 0 10px;
  padding: 8px 12px;
  box-shadow: none;
  background: #fff;
}
.suite-page .suite-hero .suite-badge,
.suite-page .suite-hero p,
.suite-page .story-source-v6,
.suite-page .suite-footer {
  display: none !important;
}
.suite-page .suite-hero h1 {
  margin: 0;
  font-size: clamp(1.25rem, 4.8vw, 1.8rem);
  line-height: 1.2;
}

.suite-page .suite-shell {
  width: min(1320px, 100%);
  padding: 0 8px 32px;
}
.suite-page .suite-panel {
  margin: 9px 0;
  padding: 11px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(80, 25, 55, .07);
}
.suite-page .suite-panel > h2 {
  margin: 0 0 8px;
  font-size: clamp(1.15rem, 4vw, 1.55rem);
}

/* Story types follow the original Japanese page order and use space efficiently. */
#storyTypeOptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
#storyTypeOptions label {
  min-width: 0;
  padding: 5px 7px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Shared attribute filter for story and attendance. */
.suite-attribute-v7 {
  margin: 8px 0;
  border: 1px solid var(--v7-line);
  border-radius: 9px;
  background: #fffafd;
}
.suite-attribute-v7 > summary {
  padding: 8px 10px;
  color: #5e2442;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.suite-attribute-v7[open] > summary { border-bottom: 1px solid var(--v7-line); }
.suite-attribute-body-v7 { padding: 8px; }
.suite-attribute-toolbar-v7 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.suite-attribute-toolbar-v7 label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid #ead7e1;
  border-radius: 7px;
  background: #fff;
}
.suite-attribute-groups-v7 { display: grid; gap: 7px; }
.suite-attribute-group-v7 {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) 1fr;
  gap: 6px;
  align-items: start;
}
.suite-attribute-group-v7 > strong {
  padding-top: 4px;
  color: #632547;
  font-size: .85rem;
}
.suite-attribute-options-v7 {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
}
.suite-attribute-options-v7 label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border: 1px solid #ead9e2;
  border-radius: 999px;
  background: #fff;
  font-size: .82rem;
}
.suite-attribute-count-v7 { color: #7b4560; font-size: .82rem; }

/* Character cards end immediately after the name and keep stars in the corner. */
.suite-character-grid {
  align-items: start;
  grid-auto-rows: max-content;
  max-height: 52vh;
  overscroll-behavior: contain;
}
.suite-character-card {
  grid-template-rows: auto auto !important;
  align-content: start;
  min-height: 0 !important;
  height: auto !important;
  gap: 1px !important;
  padding: 3px 2px !important;
}
.suite-character-card[aria-pressed="true"] { padding: 1px 0 !important; }
.suite-character-card img { width: 56px; height: 56px; }
.suite-character-card strong { margin: 0; min-height: 0; }
.suite-character-card small { display: none !important; }
.suite-character-card .suite-star {
  top: 1px !important;
  right: 3px !important;
  z-index: 5;
  font-size: .95rem !important;
  line-height: 1;
  text-shadow: 0 0 3px #fff, 0 1px 0 #fff;
}

/* Story results are responsive cards, not a 760px fixed table. */
.suite-result-group {
  margin: 8px 0;
  overflow: visible !important;
  border-radius: 9px;
}
.suite-result-group > h3 {
  position: sticky;
  top: var(--suite-nav-height-v7, 86px);
  z-index: 8;
  padding: 7px 9px;
  font-size: 1rem;
}
.story-result-list-v7 { display: grid; gap: 1px; background: #eadce3; }
.story-row-v7 {
  display: grid;
  grid-template-columns: minmax(13rem, .78fr) minmax(0, 1.22fr);
  gap: 0;
  min-width: 0;
  background: #fff;
}
.story-title-v7,
.story-cast-v7,
.story-summary-v7 {
  min-width: 0;
  padding: 7px 9px;
  overflow-wrap: anywhere;
}
.story-title-v7 {
  border-right: 1px solid #eadce3;
  font-weight: 750;
  line-height: 1.35;
}
.story-title-v7 a { color: #8a1f58; text-decoration-thickness: 1px; }
.story-title-original-v7 {
  display: block;
  margin-top: 2px;
  color: #85677a;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.25;
}
.story-cast-v7 {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 4px;
}
.story-cast-chip-v7 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px 2px 3px;
  border-radius: 999px;
  background: #f6edf2;
  color: #2c1822;
  line-height: 1.15;
}
.story-cast-chip-v7 img,
.story-cast-fallback-v7 {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}
.story-cast-fallback-v7 {
  display: grid;
  place-items: center;
  color: #fff;
  background: #a04d78;
  font-size: .68rem;
  font-weight: 800;
}
.story-cast-chip-v7 span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-summary-v7 {
  grid-column: 1 / -1;
  border-top: 1px dashed #e4d0da;
  color: #604656;
  font-size: .84rem;
  line-height: 1.42;
  white-space: pre-wrap;
}
.story-untranslated-v7 { color: #5f4552; }

/* Fixed quick rail on every tool except OCR. */
.suite-quick-rail-v7 {
  position: fixed;
  pointer-events: none;
  right: max(3px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 1600;
  display: grid;
  gap: 5px;
}
.suite-quick-rail-v7 button {
  display: grid;
  pointer-events: auto;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 12px;
  color: #fff;
  background: rgba(243, 77, 167, .93);
  box-shadow: 0 3px 10px rgba(74, 18, 49, .24);
  font: 800 1.15rem/1 sans-serif;
  cursor: pointer;
}
.suite-quick-rail-v7 button:hover,
.suite-quick-rail-v7 button:focus-visible { background: #d92f8b; outline: 3px solid rgba(243,77,167,.25); }

/* Keep the sticky mode switch compact. */
.suite-nav { margin-top: 4px; margin-bottom: 7px; }

@media (max-width: 720px) {
  .suite-page .suite-shell { padding-inline: 4px; }
  .suite-page .suite-panel { padding: 8px; }
  #storyTypeOptions { grid-template-columns: 1fr; }
  .suite-attribute-group-v7 { grid-template-columns: 1fr; gap: 2px; }
  .suite-character-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
  .suite-character-card img { width: min(52px, 100%); height: 52px; }
  .story-row-v7 { grid-template-columns: minmax(0, 1fr); }
  .story-title-v7 {
    padding: 7px 8px 4px;
    border-right: 0;
  }
  .story-cast-v7 { padding: 4px 8px 7px; }
  .story-summary-v7 { padding: 6px 8px; }
  .story-cast-chip-v7 { max-width: calc(50% - 2px); }
  .suite-quick-rail-v7 { right: 1px; gap: 2px; }
  .suite-quick-rail-v7 button { width: 32px; height: 32px; border-radius: 9px; font-size: .86rem; opacity: .82; }
}

@media (max-width: 390px) {
  .suite-character-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .story-cast-chip-v7 { max-width: 100%; }
}
