@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/playfair-display-500-latin.woff2) format('woff2');
}

.sc-page {
  --sc-ink: #111827;
  --sc-text: #0f172a;
  --sc-muted: #475569;
  --sc-line: #e2e8f0;
  --sc-soft: #f8fafc;
  --sc-danger: #b91c1c;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 16px 72px;
  color: var(--sc-text);
  font-family: 'DM Sans', system-ui, sans-serif;
}
.sc-page[hidden],
.sc-page [hidden] {
  display: none !important;
}

.sc-hero {
  text-align: center;
  max-width: 560px;
  margin: 12px auto 24px;
}
.sc-count {
  margin-left: 6px;
  font-weight: 400;
  color: #94a3b8;
}
.sc-hero h1 {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.sc-lead {
  margin: 12px 0 0;
  text-wrap: balance;
  font-size: 16px;
  line-height: 1.6;
  color: var(--sc-muted);
}
.sc-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.sc-label-first {
  margin-top: 0;
}

.sc-make,
.sc-done,
.sc-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 0 48px;
  align-items: start;
  margin-bottom: 56px;
}
.sc-view {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px;
}
.sc-make {
  grid-template-areas:
    'form preview'
    'submit preview';
}
.sc-form {
  grid-area: form;
}
.sc-preview {
  grid-area: preview;
  position: sticky;
  top: 96px;
}
.sc-submit {
  grid-area: submit;
}
.sc-preview-label {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sc-muted);
}
.sc-done {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas:
    'card head'
    'card actions';
  align-content: center;
}
.sc-done-head {
  grid-area: head;
  align-self: end;
}
.sc-done-card {
  grid-area: card;
}
.sc-done-actions {
  grid-area: actions;
}

.sc-intro {
  margin: 6px 0 4px;
  font-size: 16px;
  color: var(--sc-muted);
}
.sc-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}
.sc-photo-btn {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px dashed #94a3b8;
  border-radius: 14px;
  background: var(--sc-soft);
  font: inherit;
  text-align: left;
  color: var(--sc-text);
  cursor: pointer;
}
.sc-photo-btn:hover {
  border-color: var(--sc-ink);
}
.sc-thumb {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--sc-line);
  color: var(--sc-muted);
}
.sc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sc-photo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sc-photo-text strong {
  font-size: 16px;
  font-weight: 600;
}
.sc-photo-text small {
  font-size: 14px;
  color: var(--sc-muted);
}
.sc-options {
  margin: 0;
}

#sc-canvas,
.sc-done-card,
.sc-view-card {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 12px 32px rgba(15, 23, 42, 0.08);
  background: var(--sc-soft);
}
#sc-canvas {
  cursor: pointer;
}
.sc-form h2,
.sc-done-head h2,
.sc-view-text h2,
.sc-missing h2,
.sc-list h2 {
  margin: 0 0 4px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.sc-label {
  display: block;
  margin: 18px 0 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--sc-muted);
}
.sc-fieldset {
  border: 0;
  margin: 22px 0 0;
  padding: 0;
  min-width: 0;
}
.sc-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--sc-text);
  font: inherit;
  font-size: 16px;
}
.sc-input:focus-visible,
.sc-btn:focus-visible,
.sc-chip:focus-visible,
.sc-swatch:focus-visible,
.sc-link:focus-visible {
  outline: 2px solid var(--sc-ink);
  outline-offset: 2px;
}
.sc-error {
  min-height: 0;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--sc-danger);
}
.sc-error:empty {
  margin: 0;
}

.sc-claim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.sc-claim > span {
  font-size: 15px;
}
.sc-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: var(--sc-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.sc-chip[aria-pressed='true'] {
  background: var(--sc-ink);
  border-color: var(--sc-ink);
  color: #fff;
}
.sc-chip[aria-pressed='true']::before {
  content: '';
  width: 10px;
  height: 6px;
  margin: -3px 2px 0 0;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.sc-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.sc-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--sc-muted);
  cursor: pointer;
}
.sc-swatch i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
}
.sc-swatch[aria-pressed='true'] i {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--sc-ink);
}
.sc-swatch[aria-pressed='true'] {
  color: var(--sc-text);
  font-weight: 500;
}
.sc-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  font-size: 15px;
}
.sc-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--sc-ink);
}
.sc-fine {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--sc-muted);
}

.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid var(--sc-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.sc-btn-dark {
  background: var(--sc-ink);
  color: #fff;
}
.sc-btn-dark:hover {
  background: #1f2937;
}
.sc-btn-light {
  background: #fff;
  color: var(--sc-ink);
}
.sc-btn-light:hover {
  background: var(--sc-soft);
}
.sc-btn-sm {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 10px;
}
.sc-btn-wide {
  width: 100%;
  margin-top: 22px;
}
.sc-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.sc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.sc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 16px;
}
.sc-link {
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--sc-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sc-note {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--sc-muted);
}
.sc-done-head p,
.sc-view-text p,
.sc-missing p {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--sc-muted);
}
.sc-view-text {
  align-self: center;
}

/* Celebration when a card is created. */
.sc-confetti {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.sc-done.is-new .sc-done-card {
  animation: sc-pop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
@keyframes sc-pop {
  from {
    transform: scale(0.88);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sc-done.is-new .sc-done-card {
    animation: none;
  }
}
.sc-missing {
  text-align: center;
  margin: 0 auto 40px;
}

.sc-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.sc-filter {
  width: auto;
  max-width: 60%;
}
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.sc-grid a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sc-soft);
  aspect-ratio: 1 / 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.sc-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sc-empty {
  margin: 0;
  padding: 32px 0;
  text-align: center;
  color: var(--sc-muted);
}
.sc-more {
  display: flex;
  margin: 24px auto 0;
}

/* Crop screen, styled after the WhatsApp photo editor. */
.sc-crop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  background: #05080a;
  color: #fff;
}
.sc-crop[hidden] {
  display: none;
}
.sc-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.sc-stage img {
  position: absolute;
  pointer-events: none;
  max-width: none;
}
.sc-box {
  position: absolute;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.55);
  outline: 1px solid rgba(255, 255, 255, 0.9);
  cursor: move;
  touch-action: none;
}
.sc-box.is-circle {
  border-radius: 50%;
}
.sc-grid-v,
.sc-grid-h {
  position: absolute;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}
.sc-grid-v {
  top: 0;
  bottom: 0;
  width: 1px;
}
.sc-grid-h {
  left: 0;
  right: 0;
  height: 1px;
}
.sc-h {
  position: absolute;
  width: 32px;
  height: 32px;
  touch-action: none;
}
.sc-h::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid #fff;
}
.sc-h-nw {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}
.sc-h-nw::before {
  left: 0;
  top: 0;
  border-width: 3px 0 0 3px;
}
.sc-h-ne {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}
.sc-h-ne::before {
  right: 0;
  top: 0;
  border-width: 3px 3px 0 0;
}
.sc-h-sw {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}
.sc-h-sw::before {
  left: 0;
  bottom: 0;
  border-width: 0 0 3px 3px;
}
.sc-h-se {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}
.sc-h-se::before {
  right: 0;
  bottom: 0;
  border-width: 0 3px 3px 0;
}
.sc-e {
  position: absolute;
  touch-action: none;
}
.sc-e::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}
.sc-e-n,
.sc-e-s {
  left: 50%;
  width: 48px;
  height: 28px;
  margin-left: -24px;
  cursor: ns-resize;
}
.sc-e-n {
  top: -14px;
}
.sc-e-s {
  bottom: -14px;
}
.sc-e-n::before,
.sc-e-s::before {
  width: 24px;
  height: 3px;
}
.sc-e-w,
.sc-e-e {
  top: 50%;
  width: 28px;
  height: 48px;
  margin-top: -24px;
  cursor: ew-resize;
}
.sc-e-w {
  left: -14px;
}
.sc-e-e {
  right: -14px;
}
.sc-e-w::before,
.sc-e-e::before {
  width: 3px;
  height: 24px;
}
.sc-crop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
}
.sc-crop-bar button {
  min-width: 72px;
  padding: 12px 8px;
  border: 0;
  background: none;
  color: #25d366;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
}
.sc-crop-bar #sc-crop-rotate {
  display: flex;
  justify-content: center;
  color: #fff;
}

/* Share sheet (used where the phone's own share menu is not available). */
.sc-sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
}
.sc-sheet-wrap[hidden] {
  display: none;
}
.sc-sheet {
  width: 100%;
  max-width: 480px;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: #fff;
}
.sc-grab {
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 2px;
  background: #cbd5e1;
}
.sc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.sc-sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.sc-close {
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: var(--sc-muted, #475569);
  cursor: pointer;
}
.sc-apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 6px;
}
.sc-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
}
.sc-app i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
}
.sc-app img {
  width: 28px;
  height: 28px;
  filter: invert(1);
}

@media (max-width: 760px) {
  .sc-page {
    padding-top: 20px;
  }
  .sc-make,
  .sc-done,
  .sc-view {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .sc-make {
    grid-template-areas: 'form' 'preview' 'submit';
  }
  .sc-done {
    grid-template-areas: 'head' 'card' 'actions';
    gap: 18px;
  }
  .sc-done-head {
    text-align: center;
  }
  .sc-done-actions .sc-links {
    justify-content: center;
  }
  .sc-preview {
    position: static;
  }
  .sc-submit .sc-check {
    margin-top: 0;
  }
  .sc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .sc-list-head {
    flex-wrap: wrap;
  }
  .sc-filter {
    max-width: none;
    width: 100%;
  }
}

.sc-fieldset > legend.sc-label {
  margin: 0 0 8px;
}
