:root {
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #201e20;
  background: #f5f4ef;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 4%, rgba(103, 155, 224, .20), transparent 31rem),
    radial-gradient(circle at 8% 96%, rgba(172, 196, 178, .25), transparent 28rem),
    linear-gradient(145deg, #fffdf8, #f1f3f7 55%, #edf3ef);
}

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

.intro { margin-bottom: 22px; }
.eyebrow {
  color: #3569b7;
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  margin: 8px 0;
}
h1 { font-size: clamp(2.25rem, 7vw, 4.2rem); line-height: .98; }
h2 { font-size: 1.7rem; }
p { color: #66666e; line-height: 1.6; }

.card {
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 28px;
  background: rgba(255,255,255,.70);
  box-shadow: 0 18px 50px rgba(38, 48, 64, .10);
  backdrop-filter: blur(18px);
}

.pairing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  gap: clamp(22px, 5vw, 42px);
  align-items: center;
}
.pairing-layout p { margin-bottom: 0; }
.qr-code {
  aspect-ratio: 1;
  padding: 12px;
  border: 1px solid rgba(45, 64, 91, .12);
  border-radius: 22px;
  background: white;
  box-shadow: 0 10px 28px rgba(38, 48, 64, .10);
}
.qr-code svg { display: block; width: 100%; height: 100%; }
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 20px;
  color: #777780;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.divider::before, .divider::after {
  height: 1px;
  flex: 1;
  background: rgba(45, 64, 91, .13);
  content: "";
}

form { display: grid; gap: 12px; }
label { font-weight: 700; }
input {
  width: 100%;
  padding: 17px 18px;
  border: 1px solid rgba(45, 64, 91, .16);
  border-radius: 16px;
  outline: none;
  background: rgba(255,255,255,.86);
  color: #201e20;
  font: 700 clamp(1rem, 4vw, 1.35rem) ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
input:focus { border-color: #3973c9; box-shadow: 0 0 0 4px rgba(57,115,201,.12); }

button {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, #222b38, #3973c9);
  color: white;
  font: 700 1rem inherit;
  cursor: pointer;
}
button:hover { filter: brightness(1.05); }
button:disabled { cursor: wait; opacity: .65; }
button.secondary { background: #dce8f8; color: #285a9f; }
button.quiet { background: transparent; color: #66666e; }

.status { min-height: 1.5em; margin: 12px 0 0; }
.status.error { color: #a23f34; }
.hidden { display: none; }
.preview-panel { margin-top: 22px; }
.preview-heading { display: flex; gap: 18px; justify-content: space-between; align-items: start; }
.deleted-badge {
  padding: 7px 11px;
  border-radius: 999px;
  background: #deeee3;
  color: #39704a;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.preview {
  min-height: 360px;
  margin: 18px 0;
  border: 1px solid rgba(45, 64, 91, .12);
  border-radius: 18px;
  overflow: hidden;
  background: white;
}
.preview iframe, .preview img { width: 100%; min-height: 520px; border: 0; object-fit: contain; }
.preview pre { margin: 0; padding: 24px; white-space: pre-wrap; font: 15px/1.55 ui-monospace, monospace; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.privacy-note { max-width: 650px; margin: 22px auto 0; text-align: center; font-size: .82rem; }

@media (max-width: 560px) {
  .shell { padding-top: 30px; }
  .pairing-layout { grid-template-columns: 1fr; }
  .qr-code { width: min(100%, 240px); margin: 0 auto; }
  .preview-heading { display: block; }
  .deleted-badge { display: inline-block; margin-top: 8px; }
  .actions button { width: 100%; }
}

@media print {
  body { background: white; }
  .intro, #code-panel, .preview-heading, .actions, .privacy-note { display: none !important; }
  .shell, .card, .preview { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
}
