:root {
  color-scheme: light;
  --bg: #f3f6f2;
  --bg-soft: #e9eeea;
  --surface: #fbfcfa;
  --surface-strong: #e2e9e3;
  --text: #1d2823;
  --text-soft: #4f5f57;
  --text-faint: #5f6e66;
  --line: #d3ddd5;
  --line-strong: #b9c9bd;
  --accent: #b94231;
  --accent-strong: #8f2e23;
  --accent-soft: #f6d9d2;
  --accent-ink: #fffaf7;
  --qr-paper: #fffefa;
  --qr-ink: #1d2823;
  --shadow: 0 22px 60px rgba(43, 64, 52, 0.09);
  --shadow-small: 0 8px 24px rgba(43, 64, 52, 0.07);
  --radius-panel: 24px;
  --radius-control: 14px;
  --radius-pill: 999px;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #181e1b;
  --bg-soft: #222a26;
  --surface: #202824;
  --surface-strong: #29342e;
  --text: #edf3ee;
  --text-soft: #b9c6bd;
  --text-faint: #a3b0a7;
  --line: #35443b;
  --line-strong: #4a5b50;
  --accent: #ed745d;
  --accent-strong: #ff957e;
  --accent-soft: #4e2f29;
  --accent-ink: #201410;
  --qr-paper: #fdfdf8;
  --qr-ink: #18201b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  --shadow-small: 0 8px 24px rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #181e1b;
    --bg-soft: #222a26;
    --surface: #202824;
    --surface-strong: #29342e;
    --text: #edf3ee;
    --text-soft: #b9c6bd;
    --text-faint: #a3b0a7;
    --line: #35443b;
    --line-strong: #4a5b50;
    --accent: #ed745d;
    --accent-strong: #ff957e;
    --accent-soft: #4e2f29;
    --accent-ink: #201410;
    --qr-paper: #fdfdf8;
    --qr-ink: #18201b;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
    --shadow-small: 0 8px 24px rgba(0, 0, 0, 0.18);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 6%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: 'Avenir Next', Avenir, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100dvh;
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  grid-template-rows: repeat(3, 5px);
  gap: 3px;
  width: 25px;
  height: 25px;
  padding: 3px;
  border: 1px solid var(--text);
  border-radius: 7px;
  transform: rotate(-8deg);
}

.brand-mark span {
  display: block;
  border-radius: 1px;
  background: var(--text);
}

.brand-mark span:nth-child(2),
.brand-mark span:nth-child(5),
.brand-mark span:nth-child(8) {
  background: var(--accent);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-copy small {
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 100%;
}

.nav-link {
  position: relative;
  color: var(--text-soft);
  font-size: 13px;
  transition: color 180ms ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: '';
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.theme-toggle:active,
.text-button:active,
.secondary-button:active,
.primary-button:active {
  transform: translateY(1px) scale(0.98);
}

.theme-icon {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0.7fr;
  align-items: end;
  gap: 48px;
  padding: 62px 0 34px;
}

.intro-copy {
  max-width: 680px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 15px;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 680;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.intro-lede {
  max-width: 540px;
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.65;
}

.intro-aside {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
  padding-bottom: 8px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 96px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 68%, transparent), color-mix(in srgb, var(--bg-soft) 72%, transparent));
  color: var(--text-faint);
  text-align: center;
}

.ad-slot span {
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ad-slot p {
  max-width: 32rem;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.ad-slot-top {
  margin: 0 0 22px;
}

.ad-slot-result {
  min-height: 118px;
  margin-top: 28px;
}

/* Ads are intentionally not connected yet; keep the creation flow focused. */
.ad-slot-top,
.ad-slot-result {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, 0.97fr);
  gap: 20px;
  align-items: stretch;
}

.form-panel,
.preview-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.form-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.panel-heading,
.preview-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h2,
.preview-topline h2,
.section-heading h2,
.use-cases h2,
.faq-section h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.panel-number {
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: var(--bg-soft);
}

.mode-tab {
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.mode-tab:hover {
  color: var(--text);
}

.mode-tab.is-active {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(43, 64, 52, 0.08);
  color: var(--text);
}

.dynamic-fields {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.dynamic-fields[data-type='wifi'],
.dynamic-fields[data-type='vcard'],
.dynamic-fields[data-type='email'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dynamic-fields[data-type='text'],
.dynamic-fields[data-type='email'] .field-group:last-child {
  grid-column: 1 / -1;
}

.field-group {
  display: grid;
  gap: 9px;
  margin-top: 0;
}

.field-group label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--bg);
  color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input {
  min-height: 48px;
  padding: 0 14px;
  font-size: 14px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 15px 16px;
  font-size: 15px;
  line-height: 1.6;
}

textarea::placeholder {
  color: var(--text-faint);
}

input::placeholder {
  color: var(--text-faint);
}

input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  outline: none;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent);
}

.field-help {
  margin: 0;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.checkbox-field {
  align-content: end;
}

.checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--bg);
}

.checkbox-field input {
  width: 17px;
  min-height: 17px;
  height: 17px;
  padding: 0;
  accent-color: var(--accent);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.field-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--accent-strong);
  font-size: 12px;
}

.is-over-limit {
  color: var(--accent-strong);
  font-weight: 700;
}

.settings-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.compact-field {
  width: min(210px, 100%);
  margin-top: 0;
}

select {
  appearance: none;
  padding: 12px 36px 12px 14px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  font-size: 13px;
}

.settings-note {
  margin: 0 0 12px;
  color: var(--text-faint);
  font-size: 11px;
  text-align: right;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 0;
  padding-top: 24px;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 650;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
}

.primary-button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.primary-button:disabled {
  opacity: 0.58;
}

.button-arrow {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.text-button {
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
}

.text-button:hover {
  color: var(--text);
}

.preview-panel {
  display: flex;
  min-height: 620px;
  flex-direction: column;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface-strong);
}

.preview-status {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.qr-stage {
  display: grid;
  place-items: center;
  min-height: 314px;
  margin: 30px 0 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 47%, transparent);
}

.qr-code {
  display: grid;
  place-items: center;
  min-width: 236px;
  min-height: 236px;
  padding: 18px;
  border-radius: 18px;
  background: var(--qr-paper);
  box-shadow: var(--shadow);
}

.qr-code canvas,
.qr-code img {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-canvas {
  width: min(100%, 236px);
}

.qr-empty {
  display: none;
  max-width: 220px;
  margin: 0;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.qr-skeleton {
  display: none;
  width: 236px;
  height: 236px;
  border-radius: 18px;
  background: linear-gradient(110deg, var(--surface) 25%, color-mix(in srgb, var(--surface) 72%, var(--accent-soft)) 42%, var(--surface) 58%);
  background-size: 200% 100%;
}

.preview-panel.is-loading .qr-code,
.preview-panel.is-empty .qr-code {
  display: none;
}

.preview-panel.is-loading .qr-skeleton {
  display: block;
  animation: shimmer 1.3s ease-in-out infinite;
}

.preview-panel.is-empty .qr-empty {
  display: block;
}

.preview-bottom {
  display: grid;
  gap: 20px;
  margin-top: auto;
}

.preview-content {
  overflow: hidden;
  margin: 0;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--text-soft);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.secondary-button:disabled {
  color: var(--text-faint);
  opacity: 0.65;
}

.small-button {
  min-height: 42px;
  padding: 0 17px;
}

.how-it-works {
  display: grid;
  grid-template-columns: 0.8fr 1.5fr;
  gap: 80px;
  padding: 120px 0 108px;
}

.section-heading h2 {
  max-width: 260px;
}

.section-heading p {
  max-width: 240px;
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  align-self: start;
  border-top: 1px solid var(--line);
}

.workflow-item {
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 170px;
  padding: 20px 20px 0 0;
  border-right: 1px solid var(--line);
}

.workflow-item + .workflow-item {
  padding-left: 20px;
}

.workflow-item:last-child {
  border-right: 0;
  padding-right: 0;
}

.workflow-index {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.workflow-item h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.workflow-item p {
  max-width: 170px;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.65;
}

.use-cases {
  padding: 0 0 92px;
}

.use-cases h2,
.faq-section h2 {
  max-width: 520px;
  margin: 0 0 26px;
}

.use-case-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.use-case-grid article {
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.use-case-grid article:nth-child(2),
.use-case-grid article:nth-child(3) {
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface));
}

.use-case-grid h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.use-case-grid p,
.faq-list p {
  margin: 11px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.faq-section {
  padding: 0 0 70px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.faq-list summary {
  cursor: pointer;
  padding: 17px 18px;
  color: var(--text);
  font-weight: 650;
}

.faq-list summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

.faq-list details p {
  padding: 0 18px 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.site-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: var(--shadow-small);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.clipboard-helper {
  position: fixed;
  inset: auto auto 0 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (min-width: 821px) and (max-height: 960px) {
  .intro {
    gap: 32px;
    padding: 24px 0 18px;
  }

  .intro h1 {
    max-width: 760px;
    font-size: clamp(38px, 4.8vw, 58px);
    line-height: 0.96;
  }

  .intro-lede {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.45;
  }

  .intro-aside {
    padding-bottom: 0;
  }

  .workspace {
    gap: 18px;
  }

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

  .preview-panel {
    min-height: 540px;
  }

  .qr-stage {
    min-height: 240px;
    margin: 18px 0 16px;
  }

  .qr-code,
  .qr-skeleton {
    min-width: 210px;
    min-height: 210px;
  }

  .qr-code {
    padding: 14px;
  }

  .preview-bottom {
    gap: 12px;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 32px, 680px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 68px;
  }

  .site-nav {
    display: none;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 58px 0 34px;
  }

  .intro h1 {
    max-width: 600px;
    font-size: clamp(42px, 12vw, 64px);
  }

  .intro-aside {
    justify-content: flex-start;
  }

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

  .preview-panel {
    min-height: 460px;
  }

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

  .dynamic-fields[data-type='wifi'],
  .dynamic-fields[data-type='vcard'],
  .dynamic-fields[data-type='email'] {
    grid-template-columns: 1fr;
  }

  .how-it-works {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 80px 0;
  }

  .section-heading h2,
  .section-heading p {
    max-width: none;
  }

  .workflow-list {
    grid-template-columns: 1fr;
  }

  .workflow-item,
  .workflow-item + .workflow-item,
  .workflow-item:last-child {
    grid-template-columns: 30px 1fr;
    min-height: auto;
    gap: 10px;
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workflow-item:last-child {
    border-bottom: 0;
  }

  .workflow-item p {
    max-width: none;
  }

  .use-case-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .page-shell {
    width: min(100% - 24px, 680px);
  }

  .theme-toggle {
    padding: 8px 10px;
  }

  .theme-toggle #theme-label {
    display: none;
  }

  .intro {
    padding-top: 46px;
  }

  .intro-lede {
    font-size: 15px;
  }

  .form-panel,
  .preview-panel {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .settings-row {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .compact-field {
    width: 100%;
  }

  .settings-note {
    margin: 0;
    text-align: left;
  }

  .form-actions,
  .preview-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions {
    gap: 8px;
  }

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

  .text-button {
    min-height: 38px;
  }

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

  .qr-code,
  .qr-skeleton {
    min-width: 204px;
    min-height: 204px;
    width: 204px;
    height: 204px;
    padding: 14px;
  }

  .ad-slot-top,
  .ad-slot-result {
    min-height: 88px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 820px) {
  .intro {
    gap: 14px;
    padding: 24px 0 18px;
  }

  .intro h1 {
    max-width: 330px;
    font-size: clamp(34px, 10vw, 42px);
    line-height: 0.98;
  }

  .intro-lede,
  .intro-aside {
    display: none;
  }

  .workspace {
    gap: 16px;
  }

  .form-panel {
    padding: 20px;
  }

  .panel-heading h2 {
    font-size: 22px;
  }

  .mode-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    margin-top: 16px;
    padding: 3px;
  }

  .mode-tab {
    min-height: 38px;
    padding: 8px 3px;
    font-size: 10px;
    white-space: nowrap;
  }

  .dynamic-fields {
    gap: 10px;
    margin-top: 14px;
  }

  .field-group {
    gap: 6px;
  }

  .field-help {
    font-size: 10px;
    line-height: 1.25;
  }

  .field-error {
    min-height: 0;
    margin-top: 8px;
  }

  .settings-row {
    margin-top: 12px;
    gap: 6px;
  }

  .settings-note {
    margin: 0;
  }

  .form-actions {
    gap: 6px;
    padding-top: 14px;
  }

  .preview-panel {
    min-height: 460px;
  }

  .qr-stage {
    min-height: 240px;
    margin: 20px 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
