:root {
  --black: #000;
  --ink: #111;
  --muted: #757575;
  --line: #e0e0e0;
  --paper: #f7f7f7;
  --white: #fff;
  --field: 220px;
  --font: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
}

.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 2rem;
  background: linear-gradient(to bottom, var(--paper) 60%, transparent);
}

.logo {
  text-decoration: none;
  color: var(--black);
}

.logo-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-free {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.18em;
}

.page {
  min-height: 100dvh;
  width: min(920px, calc(100% - 3rem));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 7rem 0 4rem;
  gap: 2.25rem;
}

.seo-lead,
.seo-sub {
  margin: 0 auto;
  max-width: 34rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.55;
  color: var(--muted);
}

.seo-lead {
  font-weight: 600;
  color: var(--ink);
}

.seo-sub {
  margin-top: -1.4rem;
}

.faq {
  margin: 0.5rem auto 0;
  max-width: 36rem;
}

.faq h2 {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.faq h3 {
  margin: 1.05rem 0 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.faq p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #8a8a8a;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.field .field-label {
  margin-bottom: 0;
}

.surface {
  width: 100%;
  height: var(--field);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.input-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.input-shell:hover {
  border-color: #c8c8c8;
}

.input-shell:focus-within {
  border-color: var(--black);
}

.type-wrap {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 1;
}

.type-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #efefef url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.38rem 1.45rem 0.38rem 0.55rem;
  cursor: pointer;
  outline: none;
}

.type-select:hover,
.type-select:focus {
  border-color: #bdbdbd;
  background-color: #e8e8e8;
}

.input-shell textarea {
  flex: 1;
  width: 100%;
  height: 100%;
  resize: none;
  border: none;
  background: transparent;
  padding: 2.55rem 1.1rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.5;
  outline: none;
}

.input-shell textarea::placeholder {
  color: #a3a3a3;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.85rem;
}

.code-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.qr-stage {
  position: relative;
  display: grid;
  place-items: center;
  background: #ececec;
  cursor: default;
}

.result-row > .icon-btn {
  margin-top: calc(var(--field) - 44px);
}

.qr-frame {
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  overflow: hidden;
}

.qr-frame.is-ready {
  opacity: 1;
}

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

.qr-empty {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #b0b0b0;
  transition: opacity 0.25s ease;
}

.qr-stage.has-code .qr-empty {
  opacity: 0;
  pointer-events: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--black);
  border-radius: 2px;
  background: var(--black);
  color: var(--white);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.icon-btn:hover:not(:disabled) {
  background: var(--white);
  color: var(--black);
}

.icon-btn:disabled {
  opacity: 0.22;
  cursor: default;
}

.icon-btn:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
}

.echo {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.echo-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.echo-box {
  width: 100%;
  height: 2.6rem;
  resize: none;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #ececec;
  color: #5c5c5c;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  outline: none;
  cursor: default;
  overflow: auto;
  white-space: nowrap;
}

.echo-box:focus {
  border-color: #cfcfcf;
}

.fineprint {
  margin: 0 auto;
  max-width: 34rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: #8a8a8a;
}

@media (max-width: 760px) {
  .page {
    width: min(440px, calc(100% - 2rem));
    padding-top: 5.5rem;
    gap: 2.75rem;
  }

  .stage {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-frame,
  .qr-empty,
  textarea.surface,
  .icon-btn {
    transition: none;
  }
}
