/* Temporary copy-review overlay; remove with docs/copy-review-overlay.md. */
.idc-copy-review {
  position: fixed;
  z-index: 100000;
  inset-block-end: max(1rem, env(safe-area-inset-bottom, 0px));
  inset-inline-start: max(1rem, env(safe-area-inset-left, 0px));
  display: grid;
  max-width: min(22rem, calc(100vw - 2rem));
  gap: 0.5rem;
  font:
    600 0.8125rem/1.4 system-ui,
    sans-serif;
}

.idc-copy-review__toggle {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem 0.5rem 0.6rem;
  border: 2px solid #28113e;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 16px rgb(40 17 62 / 25%);
  color: #28113e;
  font: inherit;
  cursor: pointer;
}

.idc-copy-review__toggle:focus-visible {
  outline: 3px solid #e8615a;
  outline-offset: 2px;
}

.idc-copy-review__track {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #b9b1c0;
  transition: background 150ms ease;
}

.idc-copy-review__track::after {
  position: absolute;
  inset-block-start: 0.125rem;
  inset-inline-start: 0.125rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 150ms ease;
}

.idc-copy-review__toggle[aria-checked="true"] .idc-copy-review__track {
  background: #28113e;
}

.idc-copy-review__toggle[aria-checked="true"] .idc-copy-review__track::after {
  transform: translateX(1rem);
}

.idc-copy-review__panel {
  padding: 0.75rem 0.9rem;
  border-radius: 0.5rem;
  background: #28113e;
  box-shadow: 0 4px 16px rgb(40 17 62 / 25%);
  color: #fff;
  font-weight: 500;
}

.idc-copy-review__panel p {
  margin: 0;
}

.idc-copy-review__panel p + p {
  margin-block-start: 0.4rem;
  font-weight: 700;
}

.idc-copy-review__swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-inline-end: 0.4rem;
  border: 2px dashed #e8615a;
  background: #ffe28a;
  vertical-align: -0.1rem;
}

.idc-copy-review-on .idc-copy-review-flag {
  outline: 2px dashed #e8615a;
  outline-offset: 2px;
  background-color: rgb(255 226 138 / 55%);
  box-decoration-break: clone;
  color: #241f20;
}

/* Images draw the marker inside their frame, so cropped cards and heroes do not clip it. */
.idc-copy-review-on img.idc-copy-review-flag,
.idc-copy-review-on .idc-copy-review-art,
.idc-copy-review-on .idc-copy-review-art-before::before,
.idc-copy-review-on .idc-copy-review-art-after::after {
  outline: 4px dashed #e8615a;
  outline-offset: -4px;
}

@media (prefers-reduced-motion: reduce) {
  .idc-copy-review__track,
  .idc-copy-review__track::after {
    transition: none;
  }
}

/* Keep the switch clear of the open mobile menu. */
html:has(.nav-drawer.is-open) .idc-copy-review {
  display: none;
}
