:root {
  color-scheme: light;

  --wit-white: #FFFFFF;
  --wit-mist: #F5F6F8;
  --wit-cloud: #ECEEF2;
  --wit-line: #E4E6EC;
  --wit-line-strong: #D3D6DE;

  --wit-ink: #0B0B0C;
  --wit-ink-soft: #26282D;
  --wit-ink-muted: #6A6E77;
  --wit-ink-faint: #9AA0A9;

  --wit-cyan: #14C4E3;
  --wit-violet: #7A3FF2;
  --wit-pink: #FF2E8B;
  --wit-coral: #FF5A3C;

  --wit-spray-full: linear-gradient(105deg, #14C4E3 0%, #7A3FF2 38%, #FF2E8B 70%, #FF5A3C 100%);
  --wit-spray: linear-gradient(100deg, #14C4E3 0%, #7A3FF2 48%, #FF2E8B 100%);

  --danger: #E11D48;

  --font-display: "Montserrat", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(11, 11, 12, .04);
  --shadow-sm: 0 1px 3px rgba(11, 11, 12, .06), 0 1px 2px rgba(11, 11, 12, .04);
  --shadow-md: 0 6px 16px rgba(11, 11, 12, .08);

  --dur-fast: 120ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--wit-white);
  color: var(--wit-ink-soft);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px 24px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--wit-ink-muted);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--wit-ink);
}

.spray-text {
  background: var(--wit-spray-full);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.spray-rule {
  background: var(--wit-spray);
}

.intro {
  max-width: 640px;
  margin: 16px 0 40px;
  font-size: 18px;
  color: var(--wit-ink-muted);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 1fr 360px;
  }
  .preview-col {
    position: sticky;
    top: 32px;
    align-self: start;
  }
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--wit-line-strong);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 24px;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--wit-ink-muted);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.tab.active {
  background: var(--wit-ink);
  color: var(--wit-white);
}

.tab:not(.active):hover {
  color: var(--wit-ink);
}

.card {
  background: var(--wit-white);
  border: 1px solid var(--wit-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 20px;
}

.card + .card {
  margin-top: 24px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--wit-ink-faint);
}

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wit-ink-faint);
}

.field-row {
  display: flex;
  gap: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .field-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .field-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

input[type="text"],
input[type="url"],
select {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--wit-ink);
  background: var(--wit-white);
  border: 1px solid var(--wit-line);
  border-radius: var(--radius-md);
}

input[type="text"]:focus,
input[type="url"]:focus,
select:focus {
  outline: none;
  border-color: var(--wit-violet);
}

input[type="text"]::placeholder {
  color: var(--wit-ink-faint);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  font-size: 14px;
  color: var(--wit-ink-soft);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--wit-violet);
}

details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--wit-ink-faint);
}

details summary:hover { color: var(--wit-ink-muted); }

details[open] summary { margin-bottom: 12px; }

.target-preview {
  margin-top: 12px;
  font-size: 12px;
  color: var(--wit-ink-faint);
  word-break: break-all;
}

.target-preview strong {
  color: var(--wit-ink-muted);
  font-weight: 500;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--wit-line);
  border-radius: var(--radius-pill);
  background: var(--wit-white);
  font-size: 12px;
  font-weight: 500;
  color: var(--wit-ink-muted);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.swatch:hover { border-color: var(--wit-line-strong); }

.swatch.active {
  border-color: var(--wit-violet);
  background: var(--wit-mist);
  color: var(--wit-ink);
}

.swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--wit-line);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--wit-white);
}

.logo-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1px solid var(--wit-line);
  border-radius: var(--radius-md);
  background: var(--wit-mist);
  color: var(--wit-ink-muted);
  cursor: pointer;
  overflow: hidden;
}

.logo-button:hover { border-color: var(--wit-violet); }

.logo-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-remove {
  font-size: 12px;
  font-weight: 600;
  color: var(--wit-ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.logo-remove:hover { color: var(--wit-pink); }

.logo-hint {
  font-size: 12px;
  color: var(--wit-ink-faint);
}

.error-text {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

.preview-card {
  overflow: hidden;
  border: 1px solid var(--wit-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: var(--wit-white);
}

.preview-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.canvas-frame {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: var(--radius-md);
}

.canvas-frame.transparent-bg {
  background-image:
    linear-gradient(45deg, var(--wit-cloud) 25%, transparent 25%),
    linear-gradient(-45deg, var(--wit-cloud) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--wit-cloud) 75%),
    linear-gradient(-45deg, transparent 75%, var(--wit-cloud) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

#qr-canvas {
  width: 260px;
  height: 260px;
  max-width: 100%;
}

.encoded-url {
  width: 100%;
}

.encoded-url-label {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--wit-ink-faint);
}

.encoded-url-value {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--wit-line);
  border-radius: var(--radius-md);
  background: var(--wit-mist);
  color: var(--wit-ink-soft);
  font-size: 12px;
  text-align: left;
  word-break: break-all;
  cursor: pointer;
  font-family: inherit;
}

.encoded-url-value:hover { border-color: var(--wit-violet); }

.download-row {
  display: flex;
  width: 100%;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn-primary {
  background: var(--wit-ink);
  color: var(--wit-white);
  border: 1px solid var(--wit-ink);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--wit-white);
  color: var(--wit-ink);
  border: 1px solid var(--wit-line-strong);
}

.btn-secondary:hover { background: var(--wit-mist); }

footer.credit {
  margin-top: 48px;
  font-size: 12px;
  color: var(--wit-ink-faint);
}

footer.credit a {
  color: var(--wit-ink-muted);
  font-weight: 600;
  text-decoration: none;
}

footer.credit a:hover { color: var(--wit-pink); }
