:root {
  --ink: #172033;
  --muted: #677084;
  --line: #dce3ee;
  --panel: rgba(255, 255, 255, 0.92);
  --soft: #f5f7fb;
  --accent: #f97316;
  --brand: #0f766e;
  --qr-shadow: 34;
  --shadow: 0 24px 70px rgba(23, 32, 51, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(249, 115, 22, 0.18), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(15, 118, 110, 0.18), transparent 24%),
    linear-gradient(135deg, #f8fafc 0%, #eef3f8 48%, #fff7ed 100%);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 22px;
  min-height: calc(100vh - 64px);
}

.panel,
.preview-panel {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.controls-panel {
  border-radius: 8px;
  padding: 24px;
  align-self: start;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  background: linear-gradient(135deg, #0f766e, #f97316);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.22);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

h1 {
  font-size: clamp(1.45rem, 2.8vw, 2.25rem);
  line-height: 1.03;
}

h2 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

label,
.label-line {
  color: #2c3448;
  font-size: 0.86rem;
  font-weight: 700;
}

.label-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

input[type="url"],
input[type="text"],
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

input[type="url"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

input[type="color"] {
  width: 100%;
  height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.preset-row,
.button-row,
.control-grid,
.slider-grid {
  display: grid;
  gap: 10px;
}

.preset-row {
  grid-template-columns: repeat(3, 1fr);
  margin: 8px 0 18px;
}

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

.model-area {
  margin: 2px 0 18px;
  padding: 14px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.model-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.model-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.model-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 286px;
  margin-top: 10px;
  overflow: auto;
  padding-right: 4px;
}

.model-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: #2c3448;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 800;
}

.model-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.model-swatch {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(23, 32, 51, 0.12);
}

.preset,
.primary-btn,
.secondary-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.compact-btn {
  min-height: 38px;
}

.upload-box {
  padding: 14px;
  border: 1px dashed rgba(15, 118, 110, 0.34);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.05);
}

input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-size: 0.86rem;
}

input[type="file"]::file-selector-button {
  height: 36px;
  margin-right: 10px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  cursor: pointer;
}

.preset {
  color: #394255;
  background: #eef3f8;
}

.preset.active,
.preset:hover {
  color: #fff;
  background: var(--brand);
}

.button-row {
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #155e75);
  box-shadow: 0 16px 32px rgba(15, 118, 110, 0.22);
}

.secondary-btn {
  color: #172033;
  background: #fff;
  border: 1px solid var(--line);
}

.preset:hover,
.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  border-radius: 8px;
  padding: 24px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  padding: 8px 13px;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.09);
  font-size: 0.82rem;
  font-weight: 800;
}

.stage-wrap {
  display: grid;
  align-items: start;
  justify-items: center;
  min-height: 0;
  padding: clamp(16px, 3vw, 34px);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 32, 51, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 51, 0.06) 1px, transparent 1px),
    #f8fafc;
  background-size: 26px 26px;
}

.qr-card {
  width: min(100%, 430px);
  margin-top: clamp(4px, 2vh, 22px);
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  padding: clamp(18px, 2.6vw, 28px);
  text-align: center;
  background: #fff;
  box-shadow: 0 calc(var(--qr-shadow) * 0.6px) calc(var(--qr-shadow) * 1.7px)
    rgba(23, 32, 51, 0.16);
}

.qr-frame {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

#qrCode {
  display: grid;
  place-items: center;
  max-width: 100%;
}

#qrCode canvas,
#qrCode svg {
  max-width: 100%;
  height: auto;
}

.qr-caption {
  margin-top: 20px;
  color: var(--accent);
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.qr-card.label-badge .qr-caption {
  display: inline-block;
  padding: 9px 15px;
  border-radius: 999px;
  color: #fff !important;
  background: var(--accent);
}

.qr-card.label-underline .qr-caption {
  display: inline-block;
  padding-bottom: 7px;
  border-bottom: 3px solid currentColor;
}

.qr-card.label-block .qr-caption {
  margin-left: auto;
  margin-right: auto;
  padding: 12px;
  border-radius: 8px;
  color: #fff !important;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.qr-url {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

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

.qr-card.frame-glass {
  border-color: rgba(255, 255, 255, 0.8);
}

.qr-card.frame-ticket {
  border: 2px dashed color-mix(in srgb, var(--accent), #ffffff 28%);
}

.qr-card.frame-stamp {
  border: 10px solid #fff;
  outline: 2px solid color-mix(in srgb, var(--brand), #111827 18%);
}

.qr-card.frame-minimal {
  border: 1px solid rgba(23, 32, 51, 0.12);
  box-shadow: none;
}

.qr-card.frame-halo {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--brand), transparent 84%),
    0 calc(var(--qr-shadow) * 0.6px) calc(var(--qr-shadow) * 1.8px) rgba(23, 32, 51, 0.18);
}

.qr-card.frame-poster {
  border: 0;
  box-shadow:
    12px 12px 0 color-mix(in srgb, var(--accent), #ffffff 35%),
    0 calc(var(--qr-shadow) * 0.48px) calc(var(--qr-shadow) * 1.5px) rgba(23, 32, 51, 0.18);
}

.qr-card.frame-luxury {
  border: 3px double color-mix(in srgb, var(--accent), #111827 18%);
}

.qr-card.frame-pixel {
  border: 2px solid var(--ink);
  box-shadow:
    8px 8px 0 color-mix(in srgb, var(--brand), #ffffff 28%),
    16px 16px 0 color-mix(in srgb, var(--accent), #ffffff 36%);
}

.feature-strip > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.feature-strip strong,
.feature-strip span {
  display: block;
}

.feature-strip strong {
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.feature-strip span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding: 10px 0;
  }

  .controls-panel,
  .preview-panel {
    padding: 16px;
  }

  .brand {
    align-items: flex-start;
  }

  .button-row,
  .control-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }

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

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

  .stage-wrap {
    padding: 12px;
  }

  .qr-card {
    width: 100%;
    margin-top: 0;
    padding: 18px;
  }
}
