.set-completion-panel {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(37, 99, 235, .18);
  background: linear-gradient(135deg, rgba(239, 246, 255, .96), rgba(255, 255, 255, .98));
}
.set-completion-panel[aria-busy="true"] .set-completion-modes,
.set-completion-panel[aria-busy="true"] .set-completion-options,
.set-completion-panel[aria-busy="true"] .set-completion-actions { opacity: .68; }

.set-completion-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.set-completion-eyebrow { color: #2563eb; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.set-completion-summary h2 { margin: .15rem 0; font-size: clamp(1.25rem, 3vw, 1.7rem); }
.set-completion-summary p { margin: 0; color: #475569; }
.set-completion-ring {
  --completion: 0;
  display: grid; place-items: center; flex: 0 0 4.4rem; width: 4.4rem; aspect-ratio: 1;
  border-radius: 50%; background: conic-gradient(#2563eb calc(var(--completion) * 1%), #dbeafe 0);
  position: relative; color: #1e3a8a; font-size: .75rem; font-weight: 800;
}
.set-completion-ring::before { content: ''; position: absolute; inset: .42rem; border-radius: inherit; background: #fff; }
.set-completion-ring span { position: relative; }
.set-completion-bar, .set-directory-progress > i { display: block; overflow: hidden; height: .42rem; margin-top: .75rem; border-radius: 999px; background: #dbeafe; }
.set-completion-bar span, .set-directory-progress > i b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #06b6d4); transition: width .2s ease; }
.set-completion-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-top: .9rem; }
.set-completion-modes button { min-width: 0; min-height: 2.75rem; padding: .65rem .7rem; border: 1px solid #cbd5e1; border-radius: .75rem; background: #fff; color: #334155; text-align: left; }
.set-completion-modes button strong, .set-completion-modes button span { display: block; }
.set-completion-modes button span { margin-top: .12rem; color: #64748b; font-size: .73rem; }
.set-completion-modes button.active, .set-completion-modes button[aria-pressed="true"] { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); color: #1d4ed8; }
.set-completion-options { margin-top: .75rem; }
.set-completion-options summary { width: fit-content; min-height: 2.75rem; display: inline-flex; align-items: center; cursor: pointer; color: #334155; font-size: .84rem; font-weight: 700; }
.set-completion-options > div { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: end; margin-top: .65rem; }
.set-completion-options label { display: grid; gap: .25rem; color: #475569; font-size: .76rem; font-weight: 700; }
.set-completion-options select { height: 2.75rem; min-height: 2.75rem; padding: .35rem 1.8rem .35rem .55rem; border: 1px solid #cbd5e1; border-radius: .55rem; background: #fff; color: #0f172a; }
.set-completion-options fieldset { display: flex; flex-wrap: wrap; gap: .55rem .8rem; padding: .4rem .65rem; border: 1px solid #dbeafe; border-radius: .6rem; }
.set-completion-options fieldset legend { float: none; width: auto; margin: 0; padding: 0 .2rem; color: #475569; font-size: .72rem; font-weight: 800; }
.set-completion-options fieldset label { display: flex; align-items: center; gap: .28rem; }
.set-completion-options fieldset:disabled { opacity: .48; }
.set-completion-variants { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.set-completion-variants span { padding: .24rem .48rem; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: .72rem; font-weight: 700; }
.set-completion-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .8rem; }
.set-completion-actions > span { color: #64748b; font-size: .77rem; }
.set-completion-actions .btn { min-height: 2.75rem; }
.set-completion-actions [data-completion-wantlist],
.set-completion-dialog-actions [data-completion-dialog-confirm] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.75rem;
  border: 1px solid #0b4fc4;
  border-radius: 11px;
  padding: .55rem .85rem;
  background: linear-gradient(180deg, #1767e8, #0b4fc4);
  color: #fff;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 8px 18px rgba(13, 79, 196, .18);
}
.set-completion-actions [data-completion-wantlist]:hover,
.set-completion-dialog-actions [data-completion-dialog-confirm]:hover {
  border-color: #083f9e;
  background: linear-gradient(180deg, #125bd2, #083f9e);
  color: #fff;
  box-shadow: 0 10px 20px rgba(13, 79, 196, .23);
}
.set-completion-actions [data-completion-wantlist]:focus-visible,
.set-completion-dialog-actions [data-completion-dialog-confirm]:focus-visible {
  outline: 2px solid #0b4fc4;
  outline-offset: 2px;
}
.set-completion-actions [data-completion-wantlist]:disabled,
.set-completion-dialog-actions [data-completion-dialog-confirm]:disabled {
  border-color: #cbd9ed;
  background: #e8eef8;
  color: #52637d;
  box-shadow: none;
  opacity: 1;
}
.set-detail-card-facts .set-completion-card-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; border: 1px solid transparent; font-size: 9px; }
.set-detail-card-facts .set-completion-card-state[hidden] { display: none; }
.set-completion-card-state.is-owned { border-color: #a7d9b7; background: #eaf7ef; color: #166534; }
.set-completion-card-state.is-missing { border-color: #edcbd0; background: #fff4f5; color: #9f2940; }
.set-completion-card-state.is-owned::before { content: '✓'; }
.set-completion-card-state.is-missing::before { content: '−'; }
.set-detail-card.is-completion-owned { border-color: rgba(22, 163, 74, .35); }
.set-detail-card.is-completion-missing { border-color: rgba(225, 29, 72, .22); }
.set-detail-ownership-filter { display: inline-flex; border: 1px solid #cbd5e1; border-radius: .55rem; overflow: hidden; background: #fff; }
.set-detail-ownership-filter button { padding: .38rem .55rem; border: 0; border-right: 1px solid #e2e8f0; background: transparent; color: #475569; font-size: .73rem; font-weight: 700; white-space: nowrap; }
.set-detail-ownership-filter button:last-child { border-right: 0; }
.set-detail-ownership-filter button.active { background: #2563eb; color: #fff; }
.set-directory-progress { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; margin-top: .6rem; color: #334155; font-size: .72rem; font-weight: 700; }
.set-directory-progress > i { grid-column: 1 / -1; height: .3rem; margin: 0; }
.set-completion-dialog { width: min(36rem, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: 1rem; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); }
.set-completion-dialog::backdrop { background: rgba(15, 23, 42, .58); }
.set-completion-dialog form { padding: 1rem; }
.set-completion-dialog button { min-height: 2.75rem; }
.set-completion-dialog header { display: flex; justify-content: space-between; gap: 1rem; }
.set-completion-dialog header span { color: #2563eb; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.set-completion-dialog h2 { margin: .15rem 0 .7rem; font-size: 1.25rem; }
.set-completion-dialog header button { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: #f1f5f9; font-size: 1.25rem; }
.set-completion-dialog-preview { display: grid; gap: .3rem; max-height: 14rem; margin: .8rem 0; padding: .65rem; overflow: auto; border-radius: .65rem; background: #f8fafc; color: #334155; font-size: .82rem; }
.set-completion-dialog-note { color: #64748b; font-size: .76rem; }
.set-completion-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }

@media (min-width: 1051px) {
  .set-detail-toolbar { grid-template-columns: max-content max-content minmax(180px, 1fr) minmax(150px, 190px) max-content max-content; }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .set-detail-toolbar { grid-template-columns: max-content minmax(180px, 1fr) max-content max-content; }
  .set-detail-toolbar-count { grid-column: 1; grid-row: 1; }
  .set-detail-toolbar-search { grid-column: 2; grid-row: 1; }
  .set-detail-filter-toggle { grid-column: 3; grid-row: 1; }
  .set-detail-view-switch { grid-column: 4; grid-row: 1; }
  .set-detail-toolbar-category { grid-column: 1 / 3; grid-row: 2; }
  .set-detail-ownership-filter { grid-column: 3 / 5; grid-row: 2; justify-self: end; }
}

@media (max-width: 767.98px) {
  .set-completion-panel { padding: .85rem; }
  .set-completion-modes { grid-template-columns: 1fr; }
  .set-completion-modes button { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .set-completion-modes button span { margin: 0; text-align: right; }
  .set-completion-options > div { display: grid; grid-template-columns: 1fr 1fr; }
  .set-completion-options select { width: 100%; }
  .set-completion-options fieldset { grid-column: 1 / -1; }
  .set-completion-actions { align-items: stretch; flex-direction: column; }
  .set-completion-actions .btn { width: 100%; }
  .set-detail-ownership-filter { grid-column: 1 / -1; grid-row: 4; width: 100%; }
  .set-detail-ownership-filter button { flex: 1; min-height: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .set-completion-bar span, .set-directory-progress > i b { transition: none; }
}
