:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f6f7f9;
  color: #172033;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --panel: #ffffff;
  --field: #f9fafb;
  --green: #13a77d;
  --green-dark: #0b7558;
  --blue: #2f6fed;
  --coral: #ed6a4a;
  --shadow: 0 18px 46px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

#app {
  min-height: 100vh;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.brand-strip {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: 2.2rem;
  line-height: 1;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.15;
}

.generator,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.generator {
  display: grid;
  gap: 22px;
  padding: 22px;
}

.url-row {
  display: grid;
  gap: 9px;
}

label,
.control-field span,
.swatch-field span {
  color: #344054;
  font-size: 0.92rem;
  font-weight: 750;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input[type='url'] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input[type='url']:focus,
input[type='range']:focus-visible,
input[type='color']:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.22);
  outline-offset: 2px;
}

.field-error {
  min-height: 19px;
  margin: 0;
  color: #bf1f3b;
  font-size: 0.88rem;
  font-weight: 700;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.primary-action {
  min-width: 146px;
  padding: 0 18px;
  background: var(--green);
  color: #ffffff;
}

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

.secondary-action {
  min-width: 112px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-action:hover:not(:disabled) {
  border-color: var(--blue);
}

.button-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.secondary-action .button-icon {
  background: #eef3ff;
  color: var(--blue);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.control-field,
.swatch-field {
  display: grid;
  align-items: center;
  min-height: 96px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.control-field {
  grid-template-columns: minmax(0, 1fr) auto;
}

.control-field input {
  grid-column: 1 / -1;
}

.control-field output {
  color: var(--coral);
  font-size: 0.9rem;
  font-weight: 800;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--green);
}

.swatch-field {
  grid-template-columns: minmax(0, 1fr) 48px;
}

input[type='color'] {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 3px;
}

.result-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  align-items: start;
  gap: 22px;
}

.result-copy {
  padding: 14px 0 0;
}

.destination-label {
  margin: 18px 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.destination-link {
  display: block;
  max-width: 100%;
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.preview-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 300px;
  border: 1px dashed #b8c0cc;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f1f3f6 25%, transparent 25%),
    linear-gradient(-45deg, #f1f3f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f3f6 75%),
    linear-gradient(-45deg, transparent 75%, #f1f3f6 75%);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
  overflow: hidden;
}

#qr-canvas {
  width: min(82%, 520px);
  height: auto;
  image-rendering: pixelated;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-message {
  min-height: 20px;
  margin: 0;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

@media (max-width: 820px) {
  .workspace {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .input-action,
  .result-band {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .generator,
  .preview-panel {
    padding: 14px;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

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