:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #5f6b7c;
  --line: #dbe1ea;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #f59e0b;
  --soft: #e6f4f1;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, "Noto Sans KR", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand,
.nav,
.footer nav,
.hero-actions,
.download-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--primary);
  border-radius: 8px;
}

.nav a,
.footer a {
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 32px;
  padding: clamp(52px, 8vw, 92px) clamp(20px, 5vw, 72px) 42px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(245, 158, 11, 0.14)),
    var(--bg);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.1rem, 4.5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

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

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

.hero-panel {
  align-self: end;
  display: grid;
  gap: 12px;
}

.metric {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  font-size: 2rem;
}

.metric span {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 24px;
  padding: 36px clamp(20px, 5vw, 72px);
}

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

.tool-panel,
.preview-panel {
  padding: 24px;
}

.section-heading h2 {
  margin: 0 0 18px;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
}

.mode-tabs,
.tabs,
.preset-row,
.size-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.mode-tabs {
  padding: 6px;
  background: #eef2f6;
  border-radius: 8px;
}

.mode-tab,
.tab,
.preset,
.template-preset,
.size-preset {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.mode-tab.active,
.tab.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.preset,
.template-preset,
.size-preset {
  color: var(--muted);
  font-weight: 700;
}

.size-buttons {
  margin-bottom: 2px;
}

.size-preset {
  min-width: 44px;
  min-height: 34px;
  padding: 0 10px;
}

.size-preset.active,
.template-preset.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

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

.field {
  display: grid;
  gap: 7px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row output {
  min-width: 58px;
  padding: 2px 8px;
  color: var(--primary-dark);
  background: var(--soft);
  border: 1px solid #9bc9c1;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.field[hidden],
.check[hidden],
.tabs[hidden],
.preset-row[hidden],
.size-buttons[hidden],
[data-barcode][hidden],
[data-qr-design][hidden] {
  display: none;
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input[type="color"] {
  padding: 5px;
}

input[type="range"] {
  padding: 0;
}

.check {
  align-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.preview-panel {
  position: sticky;
  top: 92px;
  align-self: start;
}

.qr-preview {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 20px;
  background: var(--soft);
  border: 1px dashed #9bc9c1;
  border-radius: 8px;
  overflow: auto;
}

.qr-preview span {
  max-width: 220px;
  color: var(--muted);
  text-align: center;
}

.qr-preview svg {
  max-width: 100%;
  height: auto;
}

.status {
  min-height: 28px;
  color: var(--muted);
}

.content-band,
.guide,
.page-hero,
.content-page {
  margin: 0 clamp(20px, 5vw, 72px) 36px;
}

.content-band,
.guide {
  padding: 36px 0;
}

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

.info-grid article {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.info-grid h3,
.content-page h2,
.content-page h3 {
  margin-top: 0;
}

.guide {
  display: grid;
  grid-template-columns: minmax(240px, 0.4fr) minmax(0, 0.6fr);
  gap: 24px;
  border-top: 1px solid var(--line);
}

.guide ol {
  margin: 0;
  padding-left: 22px;
}

.page-hero {
  padding: 48px 0 18px;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.15;
}

.page-hero p {
  max-width: 760px;
  color: var(--muted);
}

.content-page {
  padding: clamp(22px, 4vw, 40px);
}

.content-page section + section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

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

@media (max-width: 860px) {
  .site-header,
  .footer,
  .hero,
  .workspace,
  .guide {
    grid-template-columns: 1fr;
  }

  .site-header,
  .footer {
    align-items: flex-start;
  }

  .workspace {
    display: block;
  }

  .preview-panel {
    position: static;
    margin-top: 20px;
  }

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

  .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 34px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .tabs,
  .download-row,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tab,
  .button {
    width: 100%;
  }
}
