:root {
  color-scheme: light;
  --background: #f3f6fa;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --text: #152033;
  --muted: #637086;
  --line: #dfe5ee;
  --primary: #2457d6;
  --primary-dark: #1944b2;
  --primary-soft: #eaf0ff;
  --success: #137a4e;
  --success-soft: #e9f7f0;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 14px 42px rgba(29, 47, 75, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"],
input[type="color"] {
  accent-color: var(--primary);
}

.shell {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 36px;
}

.hero {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.eyebrow,
.step {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.intro {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 1.06rem;
}

.privacy {
  display: inline-block;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #cbd8fb;
  border-radius: 10px;
  background: var(--primary-soft);
  color: #1a418e;
  font-size: 0.9rem;
}

.card {
  margin-bottom: 20px;
  padding: 28px;
  border: 1px solid rgba(208, 217, 230, 0.9);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.drop-zone {
  display: grid;
  min-height: 210px;
  place-content: center;
  padding: 32px;
  border: 2px dashed #b9c5d8;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging {
  border-color: var(--primary);
  outline: none;
  background: var(--primary-soft);
}

.drop-zone p {
  margin-bottom: 4px;
}

.drop-zone .drop-title {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 750;
}

.button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(36, 87, 214, 0.22);
  outline-offset: 2px;
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.button.secondary:hover {
  border-color: #b8c4d5;
  background: var(--surface-muted);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.main-action {
  width: 100%;
  min-height: 54px;
  margin-top: 26px;
  font-size: 1.02rem;
}

.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.preview-frame {
  display: grid;
  min-height: 340px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.checkerboard {
  background-color: #eef1f5;
  background-image:
    linear-gradient(45deg, #dfe4eb 25%, transparent 25%),
    linear-gradient(-45deg, #dfe4eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dfe4eb 75%),
    linear-gradient(-45deg, transparent 75%, #dfe4eb 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.preview-frame img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
}

.details {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  margin: 0;
  border-top: 1px solid var(--line);
}

.details dt,
.details dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.details dt {
  padding-right: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.details dd {
  font-weight: 650;
}

.metadata-grid {
  grid-template-columns: minmax(155px, 0.42fr) minmax(0, 1.58fr);
}

.badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef1f6;
  color: #4d5c72;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.subtle,
.field-help {
  color: var(--muted);
  font-size: 0.86rem;
}

.subtle {
  margin: 14px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  font-weight: 700;
}

.field select {
  width: 100%;
  height: 46px;
  padding: 0 38px 0 12px;
  border: 1px solid #cbd4e1;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
}

.fieldset,
.background-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset legend,
.background-fieldset legend {
  padding: 0;
  font-weight: 700;
}

.fieldset:disabled {
  opacity: 0.48;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid #cbd4e1;
  border-radius: 9px;
}

.segmented label {
  cursor: pointer;
}

.segmented label + label {
  border-left: 1px solid #cbd4e1;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 10px 12px;
  text-align: center;
}

.segmented input:checked + span {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.field-help {
  margin: 7px 0 0;
  font-weight: 400;
}

.range-field > span {
  display: flex;
  justify-content: space-between;
}

.range-field output {
  color: var(--primary);
}

.range-field input {
  width: 100%;
  height: 28px;
  margin: 1px 0;
}

.background-fieldset {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.background-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: 12px;
}

.background-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.swatch {
  width: 20px;
  height: 20px;
  border: 1px solid #acb7c7;
  border-radius: 6px;
}

.swatch.white {
  background: #fff;
}

.swatch.black {
  background: #000;
}

.swatch.custom {
  background: linear-gradient(135deg, #ef4444, #fbbf24, #22c55e, #3b82f6, #a855f7);
}

#customColor {
  width: 44px;
  height: 34px;
  padding: 2px;
  border: 1px solid #cbd4e1;
  border-radius: 7px;
  background: #fff;
}

.message {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 0.9rem;
}

.message.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.download {
  width: 100%;
  margin-top: 22px;
}

.verification {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #cfe7da;
  border-radius: 13px;
  background: #f7fcf9;
}

.check-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dcefe4;
}

.check-list strong {
  color: var(--success);
}

footer {
  padding: 15px 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1040px);
    padding-top: 32px;
  }

  .card {
    padding: 20px;
    border-radius: 14px;
  }

  .preview-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    min-height: 240px;
  }

  .section-heading {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .section-heading {
    flex-direction: column;
  }

  .section-heading .button {
    width: 100%;
  }

  .details,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .details dt {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .details dd {
    padding-top: 0;
  }

  .background-options {
    align-items: flex-start;
    flex-direction: column;
  }
}
