:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-press: #d97706;
  --danger: #f87171;
  --ok: #34d399;
  --border: #334155;
  --radius: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #1e293b 0%, var(--bg) 55%);
  color: var(--text);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  letter-spacing: -0.02em;
}

.sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.badge {
  background: #7c2d12;
  color: #fed7aa;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.85rem 0 0.4rem;
}

.label:first-child { margin-top: 0; }

.input {
  width: 100%;
  font-size: 1.35rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #0b1220;
  color: var(--text);
  outline: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.barcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(50% - 4px), calc(100% - 16px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 1.35rem;
  padding: 1.15rem 1rem;
  font-size: 1.45rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #111827;
  cursor: pointer;
}

.btn:active { background: var(--accent-press); }
.btn:disabled { opacity: 0.55; cursor: wait; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.error {
  color: var(--danger);
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
}

.result { text-align: center; }

.result-label {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.pin {
  margin: 0.6rem 0 0.4rem;
  font-size: clamp(3.2rem, 14vw, 5.5rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  color: var(--ok);
  line-height: 1.1;
}

.guidance {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0.5rem 0 1.25rem;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0 0 1rem;
  text-align: left;
}

.meta dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta dd {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  word-break: break-all;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.foot a { color: var(--accent); }

@media (max-width: 520px) {
  .meta { grid-template-columns: 1fr; }
}
