.collection-actions, .collection-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}
.collection-card p, .collection-build p { margin: 0; }
.collection-owned { display: inline-flex; gap: .5rem; align-items: center; min-height: 44px; }
.collection-owned input, .collection-preview input { flex: 0 0 auto; accent-color: var(--accent); }
.collection-grid, .collection-edit-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: .85rem;
  align-items: start;
}
.collection-card {
  display: grid;
  gap: .65rem;
  padding: 1rem;
  overflow-wrap: anywhere;
}
.collection-card .button { justify-self: start; text-align: start; }
.collection-card h2 { margin: 0; font-size: 1.05rem; }
.collection-card p, .collection-build { font-size: .9rem; }
.collection-item { flex-wrap: nowrap; }
.collection-item img { flex: 0 0 auto; border-radius: .55rem; background: var(--raised); }
.collection-build { padding-top: .5rem; border-top: 1px solid var(--line); }
.collection-build summary { cursor: pointer; margin-bottom: .5rem; color: var(--accent); }
.collection-build ul { padding-inline-start: 1.25rem; }
.collection-stats { display: grid; gap: .3rem; margin-block: .6rem; }
.collection-stats div { display: flex; justify-content: space-between; gap: .75rem; }
.collection-stats dd { margin: 0; text-align: end; }
.collection-dialog {
  width: min(42rem, calc(100% - 1.5rem));
  max-height: 88dvh;
  overflow: auto;
  overflow-wrap: anywhere;
}
.collection-dialog h2 { margin-top: 0; }
.collection-dialog form { display: grid; gap: .85rem; }
.collection-dialog p { margin-block: 0; }
.collection-dialog [data-dialog-status]:empty { display: none; }
.collection-preview { margin: 0; padding: 0; list-style: none; }
.collection-preview li { border-top: 1px solid var(--line); padding-block: .65rem; }
.collection-preview label { display: flex; align-items: flex-start; gap: .65rem; }
.collection-preview small { display: block; margin-top: .25rem; }
@media (min-width: 891px) and (max-width: 1050px) {
  .site-header #navigation > a > svg { display: none; }
}
.collection-offer:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  padding-bottom: .65rem;
  font-size: .875rem;
  color: var(--muted);
}
@media (min-width: 891px) and (max-width: 1439px) {
  .site-header .header-layout { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (min-width: 1100px) and (max-width: 1320px) {
  .site-header #navigation > a { padding-inline: .5rem; }
}
@media (min-width: 1161px) and (max-width: 1240px) {
  .site-header #share-site span { display: none; }
  .site-header #share-site { width: 36px; padding: 0; }
}

.collection-toolbar { display: grid; gap: .75rem; margin-bottom: 1.05rem; }
.collection-heading, .collection-nav, .collection-controls {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.collection-heading h1 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.45rem); letter-spacing: -.035em; }
.collection-location { margin: .2rem 0 0; font-size: .79rem; color: var(--muted); }
.collection-options { position: relative; z-index: 4; }
.collection-options-toggle {
  list-style: none; display: grid; place-items: center; width: 44px; height: 44px;
  cursor: pointer; border: 1px solid var(--line); border-radius: .75rem;
  font-size: 1.35rem; letter-spacing: .12em; user-select: none;
}
.collection-options-toggle::-webkit-details-marker { display: none; }
.collection-options-panel {
  background: var(--raised, #1a1d2b); position: absolute; top: calc(100% + .35rem);
  inset-inline-end: 0; width: max-content; min-width: 10rem; padding: .3rem;
}
.collection-options-panel button {
  display: block; width: 100%; text-align: start; border: 0;
  background: none; color: inherit; font: inherit; padding: .65rem; cursor: pointer;
}
.collection-options-panel button[hidden] { display: none; }
.collection-options-panel button:hover { color: var(--accent); }
.collection-options-panel button:disabled { opacity: .5; cursor: default; }
.collection-nav { padding-block: .1rem .25rem; }
.collection-tabs, .collection-filters { display: flex; align-items: center; gap: .2rem; }
.collection-tabs {
  display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem;
  padding: 3px; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface);
}
.collection-tabs button, .collection-filters button {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: .81rem; font-weight: 650; min-height: 36px;
  padding: .4rem .6rem;
}
.collection-tabs button {
  display: inline-flex; gap: .4rem; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 .65rem; border-radius: .5rem; white-space: nowrap;
}
.collection-tabs svg { width: 16px; height: 16px; flex: none; }
.collection-tabs button:hover { color: var(--text); background: var(--raised); }
.collection-tabs [aria-pressed="true"] {
  color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.collection-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.collection-filters {
  background: color-mix(in srgb, currentColor 5%, transparent); border-radius: .55rem;
  padding: 3px;
}
.collection-filters button { min-height: 34px; padding-block: 0; }
.collection-filters [aria-pressed="true"] {
  color: var(--accent); border-radius: .45rem; background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.collection-count { margin: 0; color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.collection-count:empty, .collection-feedback:empty { display: none; }
.collection-feedback { margin: 0; color: var(--muted); font-size: .85rem; }
.collection-search {
  flex: 1 1 10rem; min-width: 0; max-width: 25rem; height: 2.45rem;
  border: 1px solid var(--line); border-radius: .55rem;
  background: var(--raised); color: inherit; padding: 0 .65rem; font: inherit; font-size: .85rem;
}
.collection-grid:is([data-collection-section="characters"],[data-collection-section="weapons"]) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.25rem), 1fr));
  align-items: stretch; gap: .95rem .6rem;
}
.collection-character { position: relative; min-width: 0; }
.collection-card-detail {
  font: inherit; color: inherit; border: 0; background: none; cursor: pointer;
  padding: 0; width: 100%; border-radius: .75rem;
  display: grid; text-align: center; gap: .27rem; justify-items: stretch;
}
.collection-portrait {
  display: grid; place-items: center; overflow: hidden; aspect-ratio: 1.15;
  border-radius: .75rem; width: 100%;
  background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--accent) 20%, var(--raised)), var(--raised));
}
.collection-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.collection-card-detail strong { font-size: .8rem; line-height: 1.15; overflow-wrap: anywhere; }
.collection-progression { color: var(--muted); font-size: .72rem; }
.collection-progression:empty { display: none; }
.collection-missing .collection-portrait { background: var(--raised); }
.collection-missing img { filter: grayscale(1); opacity: .54; }
.collection-missing strong { color: var(--muted); }
.collection-check {
  position: absolute; inset: .06rem .06rem auto auto; width: 44px; height: 44px;
  display: grid; place-items: start end; padding: .38rem; cursor: pointer;
}
.collection-check input {
  appearance: none; display: grid; place-items: center; margin: 0; cursor: pointer;
  width: 1.25rem; height: 1.25rem; border: 1px solid #fff9; border-radius: 50%;
  background: #101320cf; color: white;
}
.collection-check input:checked { background: #175c45; border-color: #9de0c2; }
.collection-check input:checked::after { content: '✓'; font-size: .8rem; line-height: 1; }
.collection-card-detail:focus-visible, .collection-check input:focus-visible, .collection-options-toggle:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (max-width: 520px) {
  .collection-toolbar { gap: .6rem; }
  .collection-controls { flex-wrap: wrap; }
  .collection-search { max-width: none; flex-basis: 100%; font-size: 16px; }
  .collection-filters button { min-height: 40px; }
  .collection-grid:is([data-collection-section="characters"],[data-collection-section="weapons"]) {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem .45rem;
  }
  .collection-dialog { inset: auto 0 0; margin: 0 auto; width: 100%; max-height: 90dvh; }
}

.collection-search-tools { flex: 1 1 16rem; max-width: 32rem; min-width: 0; display: flex; gap: .45rem; }
.collection-search-tools .collection-search { flex: 1; }
.collection-filter-toggle, .collection-filter-reset {
  display: inline-flex; gap: .35rem; align-items: center; justify-content: center;
  font: inherit; font-size: .82rem; padding: 0 .65rem; cursor: pointer; min-height: 2.45rem;
  color: inherit; background: var(--raised); border: 1px solid var(--line); border-radius: .55rem;
}
.collection-filter-reset:disabled { opacity: .48; cursor: default; }
.collection-filter-toggle[aria-expanded="true"], .collection-filter-toggle:has([data-filter-count]:not(:empty)) { color: var(--accent); }
[data-filter-count]:empty { display: none; }
[data-filter-count] {
  border-radius: 100px; padding: 0 .35rem; background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.collection-advanced-filters { padding: .8rem; }
.collection-advanced-filters[hidden] { display: none; }
.collection-filter-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: .55rem; }
.collection-filter-reset { margin-top: .65rem; }
@media (max-width: 520px) {
  .collection-search-tools { flex-basis: 100%; max-width: none; }
  .collection-filter-toggle { min-height: 44px; }
  .collection-search-tools .collection-search { height: 44px; }
}

.collection-heading-actions, .collection-sync-actions { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.collection-edit-toggle {
  min-height: 44px; padding: 0 .76rem; border: 1px solid var(--line); border-radius: .75rem;
  background: var(--raised); color: inherit; font: inherit; font-size: .85rem; cursor: pointer;
}
.collection-edit-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.collection-sync { color: var(--muted); font-size: .79rem; }
.collection-sync p { margin: 0; }
.collection-sync-actions { margin-top: .35rem; }
.collection-sync-actions:has(> :not([hidden])) { margin-bottom: .35rem; }
.collection-sync-actions [hidden] { display: none; }
.collection-sync-actions select { max-width: 100%; }
.collection-card-detail:not(button) { cursor: default; }

.collection-toolbar { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.collection-heading > div:first-child { min-width: 0; }
.collection-heading-actions { flex: 0 0 auto; }
.collection-options:not([open]) .collection-options-panel { display: none; }
.collection-filter-fields label, .collection-filter-fields select { min-width: 0; max-width: 100%; }

@media (min-width: 891px) {
  #content.shell[data-page="my-collection"] { width: min(1800px, calc(100% - 40px)); }
}

.collection-traveler-portrait { position: relative; }
.collection-traveler-portrait .collection-traveler-half { position: absolute; inset: 0; }
.collection-traveler-half--0 { clip-path: inset(0 50% 0 0); }
.collection-traveler-half--1 { clip-path: inset(0 0 0 50%); }

.collection-element-filters { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.collection-element-filters[hidden] { display: none; }
.collection-element-filters .team-element-option { display: inline-grid; place-items: center; min-width: 39px; min-height: var(--collection-control-height, 40px); padding: .3rem; }
.collection-element-filters .team-element-option[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 15%,var(--surface)); }
.collection-element-button img { display: block; width: 23px; height: 23px; object-fit: contain; }
.collection-element-button:has(img) span { display: none; }

@media (min-width: 891px) {
  .collection-grid:is([data-collection-section="characters"],[data-collection-section="weapons"]) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.6rem), 1fr));
    gap: 1.05rem .85rem;
  }
  .collection-portrait { aspect-ratio: 1.04; }
  .collection-card-detail strong { font-size: .9rem; }
}

/* Overlap the two halves briefly so the center does not show a hard seam. */
@supports ((mask-image: linear-gradient(#000, transparent)) or (-webkit-mask-image: linear-gradient(#000, transparent))) {
  .collection-traveler-half--0 {
    clip-path: none;
    -webkit-mask-image: linear-gradient(to right, #000 51%, transparent 55%);
    mask-image: linear-gradient(to right, #000 51%, transparent 55%);
  }
  .collection-traveler-half--1 {
    clip-path: none;
    -webkit-mask-image: linear-gradient(to right, transparent 45%, #000 51%);
    mask-image: linear-gradient(to right, transparent 45%, #000 51%);
  }
}

.collection-character-facets { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; margin-top: .55rem; }
.collection-character-facets[hidden] { display: none; }
.collection-character-facets .collection-element-filters { margin: 0; }
.collection-rarity-filters { display: inline-flex; gap: .25rem; align-items: center; }
.collection-rarity-filters .team-element-option {
  min-height: var(--collection-control-height, 40px); min-width: 41px; padding: .3rem .6rem; font-size: .79rem; white-space: nowrap;
}
.collection-rarity-filters [aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 15%,var(--surface)); }
.collection-rarity-filters .collection-rarity-5 { color: #ffda84; }
.collection-rarity-filters .collection-rarity-4 { color: #e0baff; }
.collection-character:is([data-character-rarity="5"],[data-weapon-rarity="5"]) .collection-portrait {
  background: radial-gradient(ellipse at 50% 20%, #8c6637, #433024 87%);
  box-shadow: inset 0 0 0 1px #ffcf7566;
}
.collection-character:is([data-character-rarity="4"],[data-weapon-rarity="4"]) .collection-portrait {
  background: radial-gradient(ellipse at 50% 20%, #74499d, #362743 87%);
  box-shadow: inset 0 0 0 1px #c38df966;
}
.collection-character.collection-missing:is([data-character-rarity="5"],[data-weapon-rarity="5"]) .collection-portrait {
  background: radial-gradient(ellipse at 50% 20%, #514031, #2d2626 87%);
}
.collection-character.collection-missing:is([data-character-rarity="4"],[data-weapon-rarity="4"]) .collection-portrait {
  background: radial-gradient(ellipse at 50% 20%, #514060, #292338 87%);
}

.collection-toolbar img, .collection-grid img, .collection-dialog img {
  -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none;
}

[data-catalogue-status][data-loading="true"] {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skeleton-collection-name { display: block; width: 62%; height: .8rem; justify-self: center; margin: .15rem 0 .1rem; }
.skeleton-collection-page .skeleton-collection-title { display: block; width: 12rem; max-width: 46vw; height: 2.45rem; }
.skeleton-collection-page .skeleton-collection-caption { display: block; width: 9rem; max-width: 40vw; height: .8rem; margin-top: .2rem; }
.skeleton-collection-page .skeleton-collection-button { width: 44px; height: 44px; border-radius: .75rem; }
.skeleton-collection-page .skeleton-collection-tabs { width: 13.5rem; max-width: 72%; height: 42px; }
.skeleton-collection-page .skeleton-collection-search { width: min(32rem,60%); height: var(--collection-control-height, 40px); }
.skeleton-collection-page .skeleton-collection-owned { width: 10.7rem; height: var(--collection-control-height, 40px); }
.skeleton-collection-page .skeleton-collection-facet { width: 39px; height: var(--collection-control-height, 40px); border-radius: .5rem; }
.skeleton-collection-page .collection-element-filters { margin: 0; }
@media (max-width: 520px) {
  .skeleton-collection-page .skeleton-collection-title { height: 1.7rem; }
  .skeleton-collection-page .skeleton-collection-search { width: 100%; height: 44px; }
  .skeleton-collection-page .skeleton-collection-owned { height: 40px; }
}

.collection-controls { --collection-control-height: 40px; justify-content: flex-start; }
.collection-controls :is(.collection-search-tools .collection-search, .collection-filter-toggle) {
  height: var(--collection-control-height); min-height: var(--collection-control-height);
}
.collection-controls .collection-character-facets { margin: 0; min-width: 0; }
.collection-controls .collection-filters button { height: calc(var(--collection-control-height) - 6px); min-height: 0; }
@media (max-width: 520px) {
  .collection-controls { --collection-control-height: 44px; }
  .collection-tabs button { min-height: 44px; padding-inline: .5rem; }
  .skeleton-collection-page .skeleton-collection-tabs { height: 52px; }
  .skeleton-collection-page .skeleton-collection-owned { height: var(--collection-control-height); }
}
.collection-controls .collection-search-tools { flex: 0 1 clamp(12rem, 27vw, 32rem); }
.collection-controls > .collection-filters, .skeleton-collection-owned { margin-inline-start: auto; }
.skeleton-collection-page .skeleton-collection-search { flex: 1 1 auto; min-width: 0; width: auto; }
.skeleton-collection-page .skeleton-collection-filter-button { flex: 0 0 4.6rem; height: var(--collection-control-height, 40px); }
.skeleton-collection-page .skeleton-collection-owned { flex: 0 0 10.7rem; }
.collection-controls .collection-character-facets[hidden] { display: none; }
@media (max-width: 1060px) {
  .collection-controls { flex-wrap: wrap; }
  .collection-controls .collection-search-tools { flex: 1 1 12rem; }
}
@media (max-width: 680px) {
  .collection-controls .collection-search-tools { flex-basis: 100%; }
  .collection-controls > .collection-filters, .skeleton-collection-owned { margin-inline-start: 0; }
}
@media (max-width: 520px) {
  .skeleton-collection-page .skeleton-collection-filter-button { height: 44px; }
}
.collection-grid .collection-portrait.skeleton-shape { width: 100%; height: auto; }

.collection-portrait.collection-weapon-portrait img { width: 83%; height: 83%; max-width: 100%; max-height: 100%; object-fit: contain; }
.collection-weapon-details { display: grid; gap: .25rem; margin-top: .35rem; }
.collection-weapon-details:not(:has(> *)) { display: none; }
.collection-weapon-details p { margin: 0; font-size: .73rem; overflow-wrap: anywhere; }
.collection-weapon-details .button { max-width: 100%; white-space: normal; font-size: .75rem; }
.collection-weapon[data-weapon-rarity="3"] .collection-portrait {
  background: radial-gradient(ellipse at 50% 20%, #415d81, #283448 87%);
  box-shadow: inset 0 0 0 1px #90b8eb77;
}
.collection-weapon[data-weapon-rarity="2"] .collection-portrait {
  background: radial-gradient(ellipse at 50% 20%, #3b6655, #263931 87%);
  box-shadow: inset 0 0 0 1px #87ccb177;
}
.collection-weapon[data-weapon-rarity="1"] .collection-portrait {
  background: radial-gradient(ellipse at 50% 20%, #60616b, #35343b 87%);
  box-shadow: inset 0 0 0 1px #bcbec577;
}

.collection-controls .collection-filter-toggle[hidden], .collection-weapon-filters[hidden] { display: none; }
.collection-weapon-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; min-width: 0; }
.collection-weapon-facet { display: flex; align-items: center; gap: .25rem; }
.collection-weapon-facet .team-element-option {
  display: inline-grid; place-items: center; min-width: 39px; min-height: var(--collection-control-height);
  padding: .3rem; white-space: nowrap;
}
.collection-weapon-facet--rarity .team-element-option { min-width: 41px; }
.collection-weapon-facet .team-element-option[aria-pressed="true"] {
  border-color: var(--accent); background: color-mix(in srgb,var(--accent) 15%,var(--surface));
}
.collection-weapon-facet img { display: block; width: 23px; height: 23px; object-fit: contain; }
.collection-weapon-facet .team-element-option:has(img) span { display: none; }
.collection-weapon-facet .collection-rarity-3 { color: #a4d5fb; }
.collection-weapon-facet .collection-rarity-2 { color: #9ce5c5; }
.collection-weapon-facet .collection-rarity-1 { color: #c9cbd4; }
