:root {
  --ink: #0b1f16;
  --ink-soft: #4a5f54;
  --paper: #f5f7f5;
  --panel: #ffffff;
  --line: #dbe6de;
  --brand: #0b3d2e;
  --brand-light: #12664c;
  --accent: #d9f2e6;
  --pending: #a8710b;
  --issued: #0b6b3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

header {
  background: var(--brand);
  color: white;
  padding: 1.25rem 1.5rem;
}

.brand-mark {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  margin-right: 0.75rem;
}

.brand-sub {
  color: var(--accent);
  font-size: 0.9rem;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
}

h1, h2 {
  margin-top: 0;
  color: var(--brand);
}

.hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.source-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--brand-light);
  background: var(--accent);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  margin-bottom: 1rem;
}

.source-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--issued);
  flex-shrink: 0;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.spec-table th {
  color: var(--ink-soft);
}

.spec-align {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.row {
  display: flex;
  gap: 0.9rem;
}

input {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

input:focus {
  outline: 2px solid var(--brand-light);
  outline-offset: 1px;
}

button {
  font: inherit;
  font-weight: 600;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  align-self: flex-start;
}

button:hover {
  background: var(--brand-light);
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.offer-grid {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

#qr-code {
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.offer-details {
  flex: 1;
  min-width: 220px;
}

.pin-box {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.pin-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.pin-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--brand);
}

.status {
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  display: inline-block;
}

.status-pending {
  background: #fbf0dd;
  color: var(--pending);
}

.status-issued {
  background: var(--accent);
  color: var(--issued);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--ink-soft);
  font-weight: 600;
}

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  padding: 1.5rem;
}
