:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --panel: #ffffff;
  --text: #17211b;
  --muted: #5b6b61;
  --line: #d8e1db;
  --accent: #b3261e;
  --accent-dark: #801711;
  --green: #1d6b52;
  --shadow: 0 14px 32px rgba(23, 33, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

[hidden] {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-link,
.back-link,
.open-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.home-link {
  flex: 0 0 auto;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 22px;
}

.section-heading p,
.summary {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.qr-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.qr-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.qr-card p,
.card-note {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.qr-box {
  display: grid;
  place-items: center;
  min-height: 236px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fdfefe;
}

.qr-box img {
  width: min(210px, 100%) !important;
  height: auto !important;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.print-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
}

.url-text {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.detail-view {
  display: grid;
  gap: 18px;
}

.alert-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 14px;
  padding: 14px 18px;
  border-left: 8px solid var(--accent);
  border-radius: 8px;
  background: #fff4f2;
  color: var(--accent-dark);
  font-size: 18px;
}

.alert-strip span {
  font-size: 28px;
  font-weight: 800;
}

.info-panel {
  display: grid;
  gap: 26px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-left: 8px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.info-panel > div:first-child {
  display: grid;
  gap: 10px;
}

.data-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

dt {
  color: var(--green);
  font-weight: 700;
}

dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .alert-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .section-heading p,
  .open-link,
  .print-button,
  .back-link,
  .alert-strip {
    display: none !important;
  }

  main {
    width: 100%;
    padding: 0;
  }

  .qr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
