:root {
  color-scheme: light dark;
  --bg: #f3f5f8;
  --panel: #fbfcfd;
  --text: #16202a;
  --muted: #4c5a68;
  --accent: #0a6fb0;
  --on-accent: #f3f7fb;
  --line: #d9e0e7;
  --error: #a3261c;
  --ring: #0a6fb0;
  --shadow: 0 2px 4px rgb(22 32 42 / 0.06), 0 4px 8px rgb(22 32 42 / 0.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --panel: #19212a;
    --text: #e3eaf1;
    --muted: #9fb0c1;
    --accent: #4db2ee;
    --on-accent: #0d1a24;
    --line: #2a3541;
    --error: #ff8f84;
    --ring: #7cc8f5;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 32px 16px 64px;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

@media (min-width: 40rem) {
  .panel {
    padding: 32px;
    border-radius: 40px;
  }
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

p,
ul {
  margin: 0;
}

.lead {
  font-size: 1.125rem;
}

.product ul {
  padding-left: 16px;
  display: grid;
  gap: 8px;
  max-width: 70ch;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

legend {
  font-weight: 600;
  margin-bottom: 8px;
}

.currencies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.currencies label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.currencies input {
  accent-color: var(--accent);
  width: 20px;
  height: 20px;
  margin: 0;
}

.button,
.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 96px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease-out;
}

.button:active,
.copy:active {
  transform: scale(0.96);
}

.button.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.copy {
  min-height: 32px;
  min-width: 64px;
  padding: 4px 8px;
  font-size: 0.875rem;
}

:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--ring);
}

.currencies label:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--ring);
}

.currencies input:focus-visible {
  box-shadow: none;
}

.status {
  font-size: 1.125rem;
  font-weight: 600;
}

.status[data-status="paid"]::before {
  content: "✓ ";
}

.pay {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 40rem) {
  .pay {
    grid-template-columns: 200px 1fr;
  }
}

.qr {
  width: 200px;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f5f8;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.actions {
  display: grid;
  gap: 8px;
}

.details {
  margin: 0;
  display: grid;
  gap: 8px;
}

.details div {
  display: grid;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg);
}

.details dt {
  color: var(--muted);
  font-size: 0.875rem;
}

.details dd {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.details dd span {
  min-width: 0;
}

.error {
  color: var(--error);
  font-weight: 600;
}

[hidden] {
  display: none !important;
}

.details .copy {
  background: var(--panel);
}
