#card-dialog {
  width: min(760px, calc(100% - 1.25rem));
  padding: 0;
  max-height: min(90dvh, 840px);
  border-color: #9d84aa;
  background: #1b1721;
  box-shadow: 0 1.5rem 5rem #08050cbf;
}
.archive-head, .archive-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem 1.15rem;
}
.archive-head { border-bottom: 1px solid #493d51; }
.archive-head span, #archive-tier { color: #e3c987; font-weight: 700; }
.archive-head .close { min-width: 44px; min-height: 44px; }
.archive-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.archive-portrait {
  margin: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(ellipse at 52% 48%, #52405f 0, #33283e 40%, #211a28 76%);
}
.archive-portrait img { width: 100%; height: clamp(250px, 45vh, 400px); object-fit: contain; }
.archive-copy { min-width: 0; align-self: center; padding: clamp(1rem, 2vw, 1.6rem); }
#archive-name { font-size: clamp(1.8rem, 4vw, 3.1rem); line-height: 1.04; }
#archive-partner { font-size: .95rem; }
.mastery-switch:not([hidden]) { display: flex; gap: .35rem; margin: 1.1rem 0; }
.mastery-switch button, .archive-nav button { min-height: 44px; }
.mastery-switch button { min-width: 48px; }
.mastery-switch [aria-pressed="true"] { background: #f2ce80; border-color: #f2ce80; color: #221b14; }
.archive-stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .4rem .95rem; margin: 1rem 0; }
.archive-stats div { padding: .45rem 0; border-top: 1px solid #514457; }
.archive-stats dt { font-size: .8rem; color: #c7b9cc; }
.archive-stats dd { font-size: 1.18rem; font-variant-numeric: tabular-nums; font-weight: 700; margin: 0; }
#archive-command { color: #e6d8eb; font-size: .85rem; }
.archive-nav { border-top: 1px solid #493d51; background: #211b27; }
.archive-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 570px) {
  .archive-body { grid-template-columns: 1fr; }
  .archive-portrait { padding: .55rem; }
  .archive-portrait img { height: clamp(140px, 25dvh, 240px); }
  .archive-head, .archive-nav { padding: .4rem .8rem; }
  .archive-copy { padding: .85rem 1rem; }
  .archive-stats { grid-template-columns: repeat(3, minmax(0,1fr)); gap: .25rem .6rem; }
  .archive-nav { position: sticky; bottom: 0; }
}
