:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #fbfcfb;
  --ink: #15201c;
  --muted: #66736d;
  --line: #dbe3df;
  --accent: #18a999;
  --accent-dark: #0b6f62;
  --warm: #f97352;
  --shadow: 0 18px 55px rgba(30, 47, 42, 0.15);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(24, 169, 153, 0.13), transparent 34%),
    linear-gradient(315deg, rgba(249, 115, 82, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.workspace {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  overflow: hidden;
  border: 1px solid rgba(219, 227, 223, 0.9);
  border-radius: 8px;
  background: rgba(251, 252, 251, 0.88);
  box-shadow: var(--shadow);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.brand-row,
.preview-top,
.file-row,
.toggle-row,
.meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 280px;
  font-size: clamp(1.42rem, 2.3vw, 2.05rem);
}

h2 {
  font-size: clamp(1.24rem, 1.7vw, 1.72rem);
}

.status-pill {
  min-width: 74px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e7f8f4;
  color: #0b6f62;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span,
.toggle span {
  color: #35423d;
  font-size: 0.82rem;
  font-weight: 750;
}

.field textarea,
.field input[type="text"],
.field input[type="color"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.field textarea {
  min-height: 94px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.field input[type="color"] {
  height: 44px;
  padding: 5px;
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent-dark);
}

output {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.preset-row,
.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.preset,
.segment,
.ghost-button,
.icon-button,
.file-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #26332e;
  font-size: 0.84rem;
  font-weight: 800;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.preset:hover,
.segment:hover,
.ghost-button:hover,
.icon-button:hover,
.file-button:hover {
  transform: translateY(-1px);
  border-color: #9ecbc4;
}

.preset.active,
.segment.active {
  border-color: var(--accent-dark);
  background: #e6f6f3;
  color: #074d44;
}

.toggle-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-dark);
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 14px;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ghost-button {
  padding: 0 14px;
}

.preview-pane {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.icon-button {
  width: 54px;
  height: 42px;
}

.icon-button.wide {
  width: 68px;
}

.icon-button.primary {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: white;
}

.qr-stage {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(21, 32, 28, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(21, 32, 28, 0.035) 1px, transparent 1px),
    #f8faf8;
  background-size: 26px 26px;
}

.qr-canvas {
  display: grid;
  place-items: center;
  width: min(100%, 560px);
  aspect-ratio: 1;
  padding: clamp(14px, 3vw, 28px);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #d9e2de 25%, transparent 25%),
    linear-gradient(-45deg, #d9e2de 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9e2de 75%),
    linear-gradient(-45deg, transparent 75%, #d9e2de 75%),
    #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  box-shadow: 0 18px 45px rgba(31, 42, 38, 0.12);
}

.qr-canvas canvas,
.qr-canvas svg {
  display: block;
  width: min(100%, 460px) !important;
  height: auto !important;
  max-height: 100%;
}

.meta-strip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

@media (max-width: 880px) {
  .app-shell {
    display: block;
    padding: 14px;
  }

  .workspace {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .controls,
  .preview-pane {
    padding: 18px;
  }

  .brand-row,
  .preview-top,
  .file-row,
  .meta-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .icon-button {
    flex: 1;
  }

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

  .qr-stage {
    min-height: 310px;
  }
}
