@font-face {
  font-family: "Inter";
  src: url("vendor/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --primary: #111827;
  --primary-hover: #1f2937;
  --ring: rgba(17, 24, 39, 0.12);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 4px 12px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 16px 40px;
}

/* Hero */
.hero { text-align: center; margin-bottom: 32px; }
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 16px;
}
h1 {
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.sub { color: var(--text-2); font-size: 17px; margin: 0 auto; max-width: 520px; }
.muted { color: var(--muted); font-size: 13px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input-card { padding: 20px; max-width: 640px; margin: 0 auto 32px; }
.label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }

.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-num { width: 18px; flex: none; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.row-input::placeholder { color: #9ca3af; }
.row-input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
.row-input.invalid { border-color: #dc2626; }
.row-remove {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.row-remove:hover { background: #f3f4f6; color: var(--text); }
.row-remove:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.add-row { margin: 10px 0 0 18px; }

.input-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.actions { display: flex; gap: 8px; }
.foot-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input-card.drag { border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }

/* Buttons */
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: #f3f4f6; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }
.btn-sm { font-size: 13px; padding: 6px 10px; }

/* Results */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.grid.single { grid-template-columns: minmax(0, 320px); justify-content: center; }

.qr-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow .2s, transform .2s;
  animation: in .25s ease-out;
}
.qr-card:hover { box-shadow: var(--shadow-lg); }
@keyframes in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.qr-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.qr-box canvas { width: 100%; height: 100%; image-rendering: pixelated; }

.qr-url {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 10px;
}
.qr-url:hover { text-decoration: underline; }
.qr-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Empty */
.empty { text-align: center; color: var(--muted); padding: 24px 0 8px; }
.empty p { margin: 8px 0 0; font-size: 14px; }
.empty-icon {
  width: 44px; height: 44px;
  margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.foot { text-align: center; margin-top: 48px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .wrap { padding-top: 40px; }
  .input-foot { flex-direction: column; align-items: stretch; }
  .actions { justify-content: flex-end; }
}
