@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito_800ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #fdfbf7;
  --surface: #ffffff;
  --text: #18181b;
  --text-muted: #52525b;
  --border: #e4e4e7;
  --danger: #b91c1c;
  --skeleton: #efebe3;
  --card: #def7ec;
  --pill: #a7f3d0;
  --pill-text: #065f46;
  --action: #047857;
  --on-action: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141619;
    --surface: #1e2126;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --border: #2e3238;
    --danger: #f87171;
    --skeleton: #2a2e34;
    --card: #06392a;
    --pill: #065f46;
    --pill-text: #d1fae5;
    --action: #34d399;
    --on-action: #141619;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 22px;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom));
}

h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 800;
  margin: 8px 0 4px;
}

h2 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
  margin: 24px 0 8px;
}

p {
  margin: 0;
}

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

.center {
  text-align: center;
  padding: 48px 20px;
}

.card {
  background: var(--card);
  border-radius: 28px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill {
  align-self: flex-start;
  background: var(--pill);
  color: var(--pill-text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.banner {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--skeleton);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.row:active {
  opacity: 0.7;
}

.check {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--action);
  display: grid;
  place-items: center;
}

.row[aria-checked="true"] .check {
  background: var(--action);
}

.check svg {
  width: 16px;
  height: 16px;
  stroke: var(--on-action);
  visibility: hidden;
}

.row[aria-checked="true"] .check svg {
  visibility: visible;
}

.name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.row[aria-checked="true"] .name {
  color: var(--text-muted);
  text-decoration: line-through;
}

.note {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

.qty {
  flex: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row[aria-checked="true"] .qty {
  background: var(--skeleton);
}

.button {
  display: inline-block;
  margin-top: 16px;
  min-height: 52px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--action);
  color: var(--on-action);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.wide {
  width: 100%;
}

.button.secondary {
  background: transparent;
  color: var(--action);
  box-shadow: inset 0 0 0 2px var(--action);
}

.button:disabled {
  opacity: 0.5;
}

.panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 28px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel h2 {
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 700;
}

.input {
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: inherit;
  font: inherit;
}

.input:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 1px;
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.hint {
  font-size: 14px;
  line-height: 20px;
}

.error {
  color: var(--danger);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions .button {
  margin-top: 4px;
  flex: 1;
}

.footer {
  margin-top: 32px;
  font-size: 14px;
  line-height: 20px;
}

.toast {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.legal-links {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 16px;
  font-size: 14px;
}

.legal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--text-muted);
}
