:root {
  --ink: #101d33;
  --paper: #eef1f6;
  --card: #ffffff;
  --navy: #12294b;
  --navy-press: #0b1c36;
  --sky-line: #a9c4e4;
  --sky: #dce8f6;
  --error: #a93226;
  --muted: #5a6678;
  font-size: 16px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family:
    "Archivo",
    system-ui,
    -apple-system,
    sans-serif;
  background:
    radial-gradient(
      circle at 50% -10%,
      #ffffff,
      var(--paper) 60%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100dvh;
}
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='320'%20height='120'%3E%3Ctext%20x='16'%20y='44'%20font-family='Archivo,Arial,sans-serif'%20font-size='24'%20font-weight='800'%20fill='%2312294b'%3EWeRewards%3C/text%3E%3Ctext%20x='150'%20y='100'%20font-family='Archivo,Arial,sans-serif'%20font-size='24'%20font-weight='800'%20fill='%2312294b'%3EWeRewards%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  transform: rotate(-22deg);
  transform-origin: center;
  opacity: 0.06;
  pointer-events: none;
  z-index: -1;
}
[hidden] {
  display: none !important;
}
.page {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}
.card {
  width: 100%;
  max-width: 34rem;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 1rem;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 18px 40px -24px rgba(16, 29, 51, 0.45);
}
.brand {
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--navy);
}
h1 {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.1;
}
.lede {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}
form {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  margin-top: 0.6rem;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1rem;
}
.opt {
  color: var(--muted);
  font-weight: 500;
  font-style: normal;
  font-size: 0.85rem;
}
input[type=text],
input[type=email],
input[type=tel],
input[type=password],
input[type=number],
textarea,
select {
  font: inherit;
  font-size: 1.15rem;
  font-weight: 500;
  padding: 0.85rem;
  border: 2.5px solid var(--ink);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--ink);
  width: 100%;
}
select {
  appearance: auto;
  -webkit-appearance: menulist;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--sky-line);
}
textarea {
  resize: vertical;
  min-height: 4.5rem;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.hint {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}
.tag-field {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.tag-field legend {
  padding: 0;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
}
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.tag-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-direction: row;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 2.5px solid var(--sky-line);
  background: var(--card);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.tag-opt input {
  accent-color: var(--navy);
  margin: 0;
}
.tag-opt:has(input:checked) {
  border-color: var(--navy);
  background: var(--sky);
}
.tag-opt:has(input:focus-visible) {
  box-shadow: 0 0 0 2px var(--sky-line);
}
.tag-opt.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.logo-field {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.logo-preview {
  width: 5rem;
  height: 5rem;
  flex: none;
  border-radius: 0.9rem;
  border: 2.5px solid var(--ink);
  background: var(--card);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.logo-preview.is-empty {
  border-style: dashed;
  border-color: var(--sky-line);
}
.logo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.logo-label {
  font-weight: 700;
}
.logo-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-small {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--ink);
  border: 2.5px solid var(--ink);
}
.btn-small:active {
  background: var(--paper);
}
.btn-small-danger {
  color: var(--error);
  border-color: var(--error);
}
.field-error {
  color: var(--error);
  font-weight: 700;
  font-size: 1rem;
}
.btn-primary {
  font: inherit;
  cursor: pointer;
  border: none;
  background: var(--navy);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  padding: 1.1rem 2rem;
  border-radius: 0.8rem;
  margin-top: 0.3rem;
}
.btn-primary:active {
  background: var(--navy-press);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: default;
}
.loc-heading {
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}
#extra-locations {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
#extra-locations:empty {
  display: none;
}
.loc-row {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 2px solid var(--sky-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
}
.loc-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.btn-add-location {
  align-self: flex-start;
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  background: none;
  border: 2px dashed var(--sky-line);
  border-radius: 10px;
  cursor: pointer;
}
.btn-add-location:active {
  background: var(--sky);
}
.btn-add-location:disabled {
  opacity: 0.35;
  cursor: default;
}
.reward-field legend {
  margin-bottom: 0;
}
#reward-rows {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.rw-row {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 2px solid var(--sky-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
}
.rw-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.rw-spend {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border: 2.5px solid var(--ink);
  border-radius: 0.6rem;
  background: var(--card);
  padding-left: 0.85rem;
}
.rw-spend:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--sky-line);
}
.rw-currency {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--muted);
}
.rw-spend input {
  border: none;
  border-radius: 0;
  padding-left: 0.25rem;
  background: none;
  min-width: 0;
}
.rw-spend input:focus {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}
.rw-emoji-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rw-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.rw-emoji-grid button {
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--sky-line);
  border-radius: 0.55rem;
  background: var(--card);
}
.rw-emoji-grid button.selected {
  border-color: var(--navy);
  background: var(--sky);
}
.rw-emoji-grid button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--sky-line);
}
.fine-print {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.done-card {
  text-align: left;
}
@media (max-width: 480px) {
  .card {
    padding: 1.5rem;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
}

/* flex-gap fallbacks for browsers below Safari 14.1 (see scripts/build-client.js) */
:root.no-flex-gap .card > * + * {
  margin-top: 0.9rem;
}
:root.no-flex-gap form > * + * {
  margin-top: 1.05rem;
}
:root.no-flex-gap label > * + * {
  margin-top: 0.4rem;
}
:root.no-flex-gap .tag-field > * + * {
  margin-top: 0.5rem;
}
:root.no-flex-gap .tag-grid > * {
  margin-right: 0.45rem;
  margin-bottom: 0.45rem;
}
:root.no-flex-gap .tag-opt > * + * {
  margin-left: 0.4rem;
}
:root.no-flex-gap .logo-field > * + * {
  margin-left: 1rem;
}
:root.no-flex-gap .logo-actions > * + * {
  margin-top: 0.35rem;
}
:root.no-flex-gap .logo-buttons > * {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}
:root.no-flex-gap #extra-locations > * + * {
  margin-top: 0.9rem;
}
:root.no-flex-gap .loc-row > * + * {
  margin-top: 0.9rem;
}
:root.no-flex-gap .loc-row-top > * + * {
  margin-left: 0.6rem;
}
:root.no-flex-gap #reward-rows > * + * {
  margin-top: 0.9rem;
}
:root.no-flex-gap .rw-row > * + * {
  margin-top: 0.9rem;
}
:root.no-flex-gap .rw-row-top > * + * {
  margin-left: 0.6rem;
}
:root.no-flex-gap .rw-spend > * + * {
  margin-left: 0.15rem;
}
:root.no-flex-gap .rw-emoji-field > * + * {
  margin-top: 0.4rem;
}
:root.no-flex-gap .rw-emoji-grid > * {
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}
