:root {
  --pet-attr-line: var(--shell-line);
  --pet-attr-line-strong: var(--shell-line-strong);
  --pet-attr-text: var(--shell-text);
  --pet-attr-muted: var(--shell-muted);
  --pet-attr-panel: var(--shell-panel);
  --pet-attr-panel-soft: var(--shell-panel-soft);
  --pet-attr-accent: var(--shell-accent);
  --pet-attr-accent-soft: var(--shell-accent-soft);
  --pet-attr-gold: var(--shell-warn);
}

.pet-attr-page-shell,
.pet-attr-page-shell *,
.pet-attr-detail-dialog,
.pet-attr-detail-dialog * {
  box-sizing: border-box;
}

.pet-attr-page-shell [hidden],
.pet-attr-detail-dialog [hidden] {
  display: none !important;
}

.pet-attr-page-shell :focus-visible,
.pet-attr-detail-dialog :focus-visible {
  outline: 2px solid var(--pet-attr-accent);
  outline-offset: 3px;
}

.pet-attr-page-shell {
  display: grid;
  gap: 14px;
  min-width: 0;
}

body.pet-attr-detail-open {
  overflow: hidden;
}

.pet-attr-hero,
.pet-attr-panel,
.pet-attr-toolbar,
.pet-attr-card,
.pet-attr-empty {
  min-width: 0;
  border: 1px solid var(--pet-attr-line);
  border-radius: 12px;
  background: var(--pet-attr-panel);
}

.pet-attr-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px;
}

.pet-attr-hero-copy,
.pet-attr-title-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pet-attr-eyebrow {
  margin: 0;
  color: var(--pet-attr-accent);
  font-size: 12px;
  font-weight: 600;
}

.pet-attr-hero h1 {
  margin: 0;
  color: var(--pet-attr-text);
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.25;
}

.pet-attr-subline {
  margin: 0;
  color: var(--pet-attr-muted);
  font-size: 14px;
  line-height: 1.6;
}

.pet-attr-hero-actions,
.pet-attr-chip-row,
.pet-attr-card-topline,
.pet-attr-card-flags,
.pet-attr-toolbar-status,
.pet-attr-toolbar-actions,
.pet-attr-toolbar-switch,
.pet-attr-card-actions,
.pet-attr-boss-switch,
.pet-attr-relation-row,
.pet-attr-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pet-attr-hero-btn,
.pet-attr-filter-chip,
.pet-attr-page-btn,
.pet-attr-form-chip,
.pet-attr-view-chip,
.pet-attr-reset-btn,
.pet-attr-skill-link,
.pet-attr-open-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 8px;
  background: var(--pet-attr-panel-soft);
  color: var(--pet-attr-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

.pet-attr-hero-btn:hover,
.pet-attr-filter-chip:hover,
.pet-attr-page-btn:hover,
.pet-attr-form-chip:hover,
.pet-attr-view-chip:hover,
.pet-attr-reset-btn:hover,
.pet-attr-skill-link:hover,
.pet-attr-open-detail:hover {
  border-color: var(--pet-attr-accent);
}

.pet-attr-hero-btn.is-primary,
.pet-attr-filter-chip.is-active,
.pet-attr-page-btn.is-active,
.pet-attr-form-chip.is-active,
.pet-attr-view-chip.is-active,
.pet-attr-open-detail {
  border-color: var(--pet-attr-accent);
  background: var(--pet-attr-accent);
  color: var(--shell-bg-0);
}

.pet-attr-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.pet-attr-search-field,
.pet-attr-filter-group,
.pet-attr-select-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pet-attr-search-field > span,
.pet-attr-filter-head strong,
.pet-attr-select-field > span {
  color: var(--pet-attr-text);
  font-size: 13px;
  font-weight: 600;
}

.pet-attr-search-field input,
.pet-attr-select-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 8px;
  background: var(--shell-field);
  color: var(--pet-attr-text);
  font: inherit;
  font-size: 15px;
}

.pet-attr-search-field input::placeholder {
  color: var(--pet-attr-muted);
}

.pet-attr-search-field input:focus,
.pet-attr-select-field select:focus {
  border-color: var(--pet-attr-accent);
}

.pet-attr-select-field option {
  background: var(--shell-field);
  color: var(--pet-attr-text);
}

.pet-attr-filters {
  border-top: 1px solid var(--pet-attr-line);
  padding-top: 12px;
}

.pet-attr-filters > summary,
.pet-attr-radar-fold > summary {
  width: fit-content;
  max-width: 100%;
  padding: 4px 0;
  color: var(--pet-attr-muted);
  font-size: 13px;
  cursor: pointer;
}

.pet-attr-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 14px;
}

.pet-attr-filter-grid > :last-child {
  grid-column: 1 / -1;
}

.pet-attr-filter-head,
.pet-attr-stats-head,
.pet-attr-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.pet-attr-filter-head small,
.pet-attr-section-head small {
  color: var(--pet-attr-muted);
  font-size: 12px;
  line-height: 1.5;
}

.pet-attr-filter-chip {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.pet-attr-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.pet-attr-filter-chip-type {
  justify-content: flex-start;
  color: var(--pet-attr-text);
  border-color: var(--pet-type-tone, var(--pet-attr-line));
  background: var(--pet-attr-panel-soft);
}

.pet-attr-filter-chip-type.is-active {
  background: var(--pet-type-glow, var(--pet-attr-accent-soft));
  border-color: var(--pet-type-tone, var(--pet-attr-accent));
  color: var(--pet-attr-text);
  box-shadow: inset 0 0 0 1px var(--pet-type-tone, var(--pet-attr-accent));
}

.pet-attr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
}

.pet-attr-status-pill {
  color: var(--pet-attr-muted);
  font-size: 12px;
  line-height: 1.5;
}

.pet-attr-status-pill strong {
  color: var(--pet-attr-text);
}

.pet-attr-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  min-width: 0;
}

.pet-attr-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.pet-attr-card > *,
.pet-attr-detail-body > * {
  min-width: 0;
}

.pet-attr-summary-head,
.pet-attr-detail-intro {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.pet-attr-portrait {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 10px;
  background: var(--pet-attr-panel-soft);
  overflow: hidden;
  color: var(--pet-attr-muted);
}

.pet-attr-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-attr-detail-intro {
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.pet-attr-card h2,
.pet-attr-title-main h3 {
  margin: 0;
  color: var(--pet-attr-text);
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pet-attr-list-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--pet-attr-muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.pet-attr-list-facts strong,
.pet-attr-list-facts b {
  color: var(--pet-attr-text);
  font-weight: 600;
}

.pet-attr-card-actions {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--pet-attr-line);
}

.pet-attr-card-actions > * {
  flex: 1 1 auto;
}

.pet-attr-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
}

.pet-attr-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-attr-icon.is-fallback {
  color: var(--pet-type-tone, var(--pet-attr-accent));
}

.pet-attr-type-chip,
.pet-attr-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 6px;
  background: var(--pet-attr-panel-soft);
  color: var(--pet-attr-text);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pet-attr-type-chip {
  border-color: var(--pet-type-tone, var(--pet-attr-line));
}

.pet-attr-meta-chip.is-gold {
  color: var(--shell-warn);
  border-color: var(--shell-warn-border);
  background: var(--shell-warn-soft);
}

.pet-attr-meta-chip.is-blue {
  color: var(--shell-info);
  border-color: var(--shell-info-border);
  background: var(--shell-info-soft);
}

.pet-attr-meta-chip.is-purple {
  color: var(--shell-special);
  border-color: var(--shell-special-border);
  background: var(--shell-special-soft);
}

.pet-attr-meta-chip.is-green {
  color: var(--shell-good);
  border-color: var(--shell-good-border);
  background: var(--shell-good-soft);
}

.pet-attr-detail-dialog {
  width: min(940px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pet-attr-line-strong);
  border-radius: 14px;
  background: var(--pet-attr-panel);
  color: var(--pet-attr-text);
  box-shadow: var(--shell-shadow);
}

.pet-attr-detail-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.pet-attr-detail-dialog::backdrop {
  background: var(--shell-backdrop);
}

.pet-attr-detail-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--pet-attr-line);
  background: var(--shell-panel-strong);
}

.pet-attr-detail-head h2 {
  min-width: 0;
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pet-attr-detail-head button {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--pet-attr-line-strong);
  border-radius: 8px;
  background: var(--pet-attr-panel);
  color: var(--pet-attr-text);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.pet-attr-detail-head button:hover {
  border-color: var(--pet-attr-accent);
}

.pet-attr-detail-body {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
  scrollbar-width: thin;
}

.pet-attr-detail-section,
.pet-attr-feature-board,
.pet-attr-evo-board,
.pet-attr-relations-board {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pet-attr-detail-section {
  padding: 14px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 10px;
  background: var(--shell-bg-0);
}

.pet-attr-detail-section h3,
.pet-attr-stats-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.pet-attr-stats-head > span,
.pet-attr-stats-head > strong {
  color: var(--pet-attr-gold);
  font-size: 13px;
}

.pet-attr-six-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.pet-attr-six-stats > * {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 9px 2px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 7px;
  background: var(--pet-attr-panel-soft);
}

.pet-attr-six-stats small {
  color: var(--pet-attr-muted);
  font-size: 11px;
  line-height: 1.3;
}

.pet-attr-six-stats strong {
  color: var(--pet-attr-text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.pet-attr-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.pet-attr-compact-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 8px;
  background: var(--pet-attr-panel-soft);
}

.pet-attr-compact-card small {
  color: var(--pet-attr-muted);
  font-size: 11px;
}

.pet-attr-compact-card strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.pet-attr-radar-fold > :not(summary) {
  margin-top: 10px;
}

.pet-attr-radar-board,
.pet-attr-radar-shell {
  display: grid;
  place-items: center;
  min-width: 0;
}

.pet-attr-radar-shell {
  width: 100%;
  padding: 12px;
}

.pet-attr-radar-svg {
  display: block;
  width: min(100%, 248px);
  height: auto;
  overflow: visible;
}

.pet-attr-radar-grid {
  fill: color-mix(in srgb, var(--shell-accent) 3.5%, transparent);
  stroke: var(--pet-attr-line);
  stroke-width: 1;
}

.pet-attr-radar-axis {
  stroke: var(--pet-attr-line-strong);
  stroke-width: 1;
}

.pet-attr-radar-label {
  fill: var(--pet-attr-muted);
  font-size: 11px;
  font-weight: 600;
}

.pet-attr-radar-label-value {
  display: inline;
  fill: var(--pet-attr-gold);
  font-weight: 700;
}

.pet-attr-radar-shape {
  fill: color-mix(in srgb, var(--pet-attr-gold) 20%, transparent);
  stroke: var(--pet-attr-gold);
  stroke-width: 2;
}

.pet-attr-radar-dot {
  fill: var(--pet-attr-gold);
  stroke: var(--pet-attr-text);
  stroke-width: 1.2;
}

.pet-attr-feature-board {
  padding: 12px;
  border: 1px solid var(--pet-attr-line);
  border-left: 3px solid var(--pet-desc-tone, var(--pet-attr-accent));
  border-radius: 8px;
  background: var(--pet-attr-panel-soft);
}

.pet-attr-feature-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pet-attr-feature-corner {
  color: var(--pet-attr-muted);
  font-size: 11px;
}

.pet-attr-feature-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pet-attr-feature-copy strong {
  font-size: 16px;
  line-height: 1.4;
}

.pet-attr-feature-copy p,
.pet-attr-description {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.pet-attr-desc-link {
  color: color-mix(in srgb, var(--pet-desc-tone, var(--pet-attr-accent)) 45%, var(--shell-text));
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.pet-attr-fold {
  min-width: 0;
  border: 1px solid var(--pet-attr-line);
  border-radius: 10px;
  background: var(--shell-bg-0);
}

.pet-attr-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  list-style: none;
  cursor: pointer;
}

.pet-attr-fold > summary::-webkit-details-marker {
  display: none;
}

.pet-attr-fold > summary::after {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--pet-attr-muted);
  border-bottom: 2px solid var(--pet-attr-muted);
  transform: rotate(45deg);
}

.pet-attr-fold[open] > summary::after {
  transform: rotate(225deg);
}

.pet-attr-fold[open] > summary {
  border-bottom: 1px solid var(--pet-attr-line);
}

.pet-attr-fold > summary span {
  font-size: 14px;
  font-weight: 600;
}

.pet-attr-fold > summary small {
  margin-left: auto;
  color: var(--pet-attr-muted);
  font-size: 11px;
}

.pet-attr-fold-body {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.pet-attr-info-grid,
.pet-attr-relations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.pet-attr-info-card,
.pet-attr-relation-card,
.pet-attr-description-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 8px;
  background: var(--pet-attr-panel-soft);
  overflow-wrap: anywhere;
}

.pet-attr-info-card small,
.pet-attr-relation-card small {
  color: var(--pet-attr-muted);
  font-size: 12px;
}

.pet-attr-info-card strong {
  font-size: 13px;
  line-height: 1.6;
}

.pet-attr-evo-path {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.pet-attr-evo-stage,
.pet-attr-evo-stage.is-vertical {
  display: grid;
  flex: 0 0 110px;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.pet-attr-evo-path.is-simple-route {
  overflow-x: visible;
  padding-bottom: 0;
}

.pet-attr-evo-path.is-simple-route .pet-attr-evo-stage {
  flex: 1 1 0;
}

.pet-attr-evo-step {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 8px;
  background: var(--pet-attr-panel-soft);
}

.pet-attr-evo-step.is-current {
  border-color: var(--pet-attr-gold);
  background: var(--shell-warn-soft);
}

.pet-attr-evo-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  max-width: 100%;
  border-radius: 8px;
  background: var(--pet-attr-panel-soft);
}

.pet-attr-evo-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-attr-evo-step strong {
  max-width: 100%;
  color: var(--pet-attr-text);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.pet-attr-evo-step small {
  color: var(--pet-attr-muted);
  font-size: 11px;
  text-align: center;
}

.pet-attr-evo-arrow {
  display: grid;
  flex: 0 0 10px;
  place-items: center;
  color: var(--pet-attr-muted);
  font-size: 11px;
}

.pet-attr-leader-showcase {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 220px);
  padding: 14px;
  border: 1px solid var(--pet-attr-line);
  border-radius: 10px;
  background: var(--pet-attr-panel-soft);
  text-align: center;
  overflow-wrap: anywhere;
}

.pet-attr-leader-portrait {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
}

.pet-attr-leader-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-attr-skill-empty {
  margin: 0;
  color: var(--pet-attr-muted);
  font-size: 12px;
  line-height: 1.5;
}

.pet-attr-empty {
  display: grid;
  gap: 8px;
  padding: 28px;
  text-align: center;
}

.pet-attr-empty strong {
  font-size: 18px;
}

.pet-attr-empty span {
  color: var(--pet-attr-muted);
  font-size: 13px;
}

.pet-attr-pagination {
  justify-content: center;
}

.pet-attr-page-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.pet-attr-page-ellipsis {
  padding: 0 3px;
  color: var(--pet-attr-muted);
}

@media (max-width: 720px) {
  .pet-attr-hero,
  .pet-attr-panel {
    padding: 16px;
  }

  .pet-attr-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pet-attr-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pet-attr-toolbar {
    padding: 12px;
  }

  .pet-attr-detail-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .pet-attr-detail-head {
    padding: 10px 12px;
  }

  .pet-attr-detail-head h2 {
    font-size: 18px;
  }

  .pet-attr-detail-body {
    gap: 12px;
    padding: 12px;
  }

  .pet-attr-detail-intro {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .pet-attr-detail-intro > .pet-attr-skill-link {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .pet-attr-search-field input,
  .pet-attr-select-field select {
    font-size: 16px;
  }

  .pet-attr-info-grid,
  .pet-attr-relations-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pet-attr-fold-body,
  .pet-attr-detail-section {
    padding: 12px;
  }

  .pet-attr-evo-path {
    gap: 4px;
  }

  .pet-attr-evo-step {
    gap: 6px;
    padding: 8px 3px;
  }

  .pet-attr-evo-avatar {
    width: 48px;
    height: 48px;
  }

  .pet-attr-evo-step strong {
    font-size: 12px;
  }

  .pet-attr-evo-arrow {
    flex-basis: 8px;
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .pet-attr-hero,
  .pet-attr-panel,
  .pet-attr-card {
    padding: 12px;
  }

  .pet-attr-card h2 {
    font-size: 18px;
  }

  .pet-attr-summary-head {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .pet-attr-summary-head .pet-attr-portrait {
    width: 56px;
    height: 56px;
  }

  .pet-attr-six-stats {
    gap: 4px;
  }

  .pet-attr-six-stats strong {
    font-size: 14px;
  }

  .pet-attr-toolbar-actions {
    width: 100%;
  }
}
