:root {
  --sfc-accent: #951641;
  --sfc-gold: #F0B529;
  --sfc-ink: #000;
  --sfc-muted: #555;
  --sfc-line: #e6e1d8;
  --sfc-off: #c9c4bb;
  --sfc-paper: #fff;
  --sfc-gap: 0.75rem;
  --sfc-radius: 6px;
  --sfc-font: "Montserrat", system-ui, sans-serif;
  --sfc-title-font: "Playfair Display", Georgia, serif;
}

.sfc,
.sfc-modal[open] {
  padding: calc(var(--sfc-gap) * 1.5);
  display: grid;
  gap: var(--sfc-gap);
  background: var(--sfc-paper);
  color: var(--sfc-ink);
  font: 0.9rem/1.5 var(--sfc-font);
  border: 0;
  border-radius: var(--sfc-radius);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.25);
}

.sfc {
  position: fixed;
  inset: auto var(--sfc-gap) var(--sfc-gap);
  z-index: 99999;
  max-width: 40rem;
  margin-inline: auto;
}

.sfc[hidden] {
  display: none;
}

.sfc-modal {
  width: min(100% - 2 * var(--sfc-gap), 36rem);
  max-height: calc(100dvh - 2 * var(--sfc-gap));
  overflow-y: auto;
}

.sfc-modal::backdrop {
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(2px);
}

:is(.sfc, .sfc-modal) p {
  margin: 0;
}

:is(.sfc, .sfc-modal) a {
  color: var(--sfc-accent);
  text-decoration: underline;
}

.sfc-title {
  display: flex;
  align-items: center;
  gap: var(--sfc-gap);
  font: 600 1.25rem var(--sfc-title-font);
}

.sfc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sfc-gap);
}

.sfc-modal .sfc-close,
.sfc-modal .sfc-close:is(:hover, :focus) {
  padding: 0.25rem 0.5rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--sfc-ink);
  background: none;
  border: 0;
  cursor: pointer;
}

.sfc-cats {
  display: grid;
  border-block: 1px solid var(--sfc-line);
}

.sfc-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--sfc-gap) * 1.5);
  padding-block: var(--sfc-gap);
  line-height: 1.5;
  cursor: pointer;
}

.sfc-cat + .sfc-cat {
  border-top: 1px solid var(--sfc-line);
}

.sfc-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--sfc-muted);
}

.sfc-always {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sfc-accent);
  white-space: nowrap;
}

.sfc-modal .sfc-switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 2.75rem;
  height: 1.5rem;
  margin: 0;
  background: var(--sfc-off);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.sfc-switch::before {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  aspect-ratio: 1;
  background: var(--sfc-paper);
  border-radius: 50%;
  transition: translate 0.2s;
}

.sfc-modal .sfc-switch:checked {
  background: var(--sfc-accent);
}

.sfc-switch:checked::before {
  translate: 1.25rem;
}

.sfc-switch:focus-visible {
  outline: 2px solid var(--sfc-accent);
  outline-offset: 2px;
}

.sfc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--sfc-gap) / 2);
}

:is(.sfc, .sfc-modal) .sfc-btn {
  flex: 1 1 8rem;
  padding: 0.6em 1em;
  font: 600 0.85rem var(--sfc-font);
  color: var(--sfc-accent);
  background: var(--sfc-paper);
  border: 2px solid var(--sfc-accent);
  border-radius: var(--sfc-radius);
  cursor: pointer;
}

:is(.sfc, .sfc-modal) .sfc-btn:is(:hover, :focus-visible),
:is(.sfc, .sfc-modal) .sfc-btn-primary {
  color: var(--sfc-paper);
  background: var(--sfc-accent);
}

:is(.sfc, .sfc-modal) .sfc-btn-gold,
:is(.sfc, .sfc-modal) .sfc-btn-gold:is(:hover, :focus-visible) {
  color: var(--sfc-ink);
  background: var(--sfc-gold);
  border-color: var(--sfc-gold);
}

:is(.sfc, .sfc-modal) :is(.sfc-btn-primary, .sfc-btn-gold):is(:hover, :focus-visible) {
  filter: brightness(1.1);
}
