.collection-shell {
  display: grid;
  gap: 1.5rem;
  max-width: 1120px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.65;
}

.collection-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.collection-heading h1 { margin: .5rem 0; font-size: clamp(2rem, 5vw, 3.7rem); }
.collection-owner, .collection-context { color: var(--muted); font-size: 15px; }

.collection-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.collection-totals div { padding: 1rem 1.25rem; background: var(--panel); }
.collection-totals dt, .collection-entry dt { color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.collection-totals dd { margin: .25rem 0 0; color: var(--gold); font: 1.35rem Cinzel, serif; }

.collection-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, .7fr);
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #171f21;
}

.collection-tools > label { display: grid; gap: .4rem; color: var(--muted); font-size: 14px; }
.collection-tools input, .collection-tools select { font-size: 16px; }
.collection-tools fieldset { display: flex; flex-wrap: wrap; gap: .35rem; grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.collection-tools legend { margin-bottom: .4rem; color: var(--muted); font-size: 14px; }
.collection-tools fieldset label { position: relative; }
.collection-tools fieldset input { position: absolute; opacity: 0; }
.collection-tools fieldset span { display: block; padding: .65rem .8rem; border: 1px solid var(--line); color: var(--muted); font-size: 14px; cursor: pointer; }
.collection-tools fieldset input:checked + span, .collection-tools fieldset input:focus-visible + span { border-color: var(--gold); background: #d8b46a18; color: var(--gold); }

.collection-results { min-width: 0; }
.collection-activity { padding: 1.5rem; border: 1px solid var(--line); background: var(--panel); }
.collection-activity > header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.collection-activity h2 { margin: .35rem 0; font-size: 1.45rem; }
.collection-activity h2 a { color: var(--text); }
.collection-activity > header > strong { color: var(--gold); font: 1.15rem Cinzel, serif; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.collection-entry { min-width: 0; border: 1px solid #ffffff18; background: #121a1c; }
.collection-entry.obtained { border-color: #d8b46a55; background: #d8b46a08; }
.collection-entry summary { display: flex; align-items: center; gap: .8rem; min-height: 82px; padding: 1rem; cursor: pointer; list-style: none; }
.collection-entry summary::-webkit-details-marker { display: none; }
.collection-entry summary > span:last-child { min-width: 0; }
.collection-entry strong, .collection-entry small { display: block; overflow-wrap: anywhere; }
.collection-entry small { margin-top: .3rem; color: var(--muted); font-size: 14px; }
.collection-mark { color: var(--gold); font-size: 1.25rem; }
.collection-entry dl { display: grid; gap: .75rem; margin: 0; padding: 0 1rem 1rem; }
.collection-entry dl div { padding-top: .65rem; border-top: 1px solid #ffffff0d; }
.collection-entry dd { margin: .2rem 0 0; font-size: 15px; overflow-wrap: anywhere; }
.collection-wiki-link { display: block; padding: .75rem 1rem; border-top: 1px solid #ffffff0d; font-size: 14px; }
.collection-empty { padding: 2rem; border: 1px solid var(--line); color: var(--muted); text-align: center; }

.collection-pages { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.collection-pages button { min-width: 112px; }
.collection-pages span { color: var(--muted); font-size: 14px; }
.collection-profile-link { max-width: 1120px; margin: 1.5rem auto 0; font-size: 16px; }

.collection-privacy { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1120px; margin: 0 auto 1.5rem; padding: 1.25rem; border: 1px solid var(--line); background: #171f21; }
.collection-privacy p { margin: 0; color: var(--muted); font-size: 15px; }
.collection-privacy form { display: flex; align-items: center; gap: .75rem; }
.collection-privacy input { accent-color: var(--gold); }

@media (max-width: 850px) {
  .collection-heading { align-items: start; flex-direction: column; }
  .collection-totals { width: 100%; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .collection-tools, .collection-grid { grid-template-columns: 1fr; }
  .collection-activity { padding: 1rem; }
  .collection-privacy { align-items: start; flex-direction: column; }
}

@media (max-width: 360px) {
  .collection-totals { grid-template-columns: 1fr; }
  .collection-tools fieldset { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .collection-tools fieldset span { padding: .7rem .35rem; text-align: center; }
  .collection-heading h1 { font-size: 2rem; }
  .collection-pages { display: grid; grid-template-columns: 1fr 1fr; }
  .collection-pages span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
}
