* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

/* This page is light-only, so say so. Without it a device in dark mode gets
   dark-mode UA styling for form controls while our own rules keep painting
   them white — a near-white label on a white button, i.e. an invisible one.
   Every control below also states its colour outright rather than inheriting
   whatever the UA picks. */
:root { color-scheme: light; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  background: #f6f5f2;
  color: #1f2328;
}

.container {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  text-align: center;
}

h1 { font-size: 1.4rem; margin-bottom: 0; }
h2 { font-size: 1.1rem; font-weight: 500; margin-top: 0.35rem; color: #555; }

button, a.primary {
  font-size: 1.05rem;
  padding: 0.8rem 1.4rem;
  border-radius: 0.6rem;
  border: 1px solid #ccc;
  background: #fff;
  color: #1f2328;
  cursor: pointer;
  margin: 0.4rem 0;
}

button.primary, a.primary {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
  width: 100%;
}

a.primary {
  display: inline-block;
  box-sizing: border-box;
  text-decoration: none;
}
button:disabled { opacity: 0.5; }

.stamps { font-size: 1.9rem; letter-spacing: 0.3rem; margin: 1rem 0 0.2rem; }
.stamp.filled { color: #1f6feb; }

.reward { font-weight: 600; }
.error { color: #b42318; }
.ok { color: #067647; }
.hint { color: #777; font-size: 0.9rem; }

.qr img { width: 230px; height: 230px; background: #fff; padding: 12px; border-radius: 0.8rem; }
.qr figcaption { color: #555; font-size: 0.9rem; margin-top: 0.4rem; }

#reader { background: #fff; border-radius: 0.8rem; overflow: hidden; }
.card-panel { margin-top: 1rem; }

/* --- merchant portal ---------------------------------------------------
   The consumer pages are a single narrow column on a phone; the portal
   shows lists and forms, so it gets more room and left-aligned text. */

.container--wide { max-width: 44rem; text-align: left; }
.container--wide h1, .container--wide h2 { text-align: left; }

.notice { color: #555; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.9rem; color: #555; }
.field input, .field select, .field textarea {
  font-size: 1.05rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 0.6rem;
  background: #fff;
  color: #1f2328;
  width: 100%;
}
.field input::placeholder { color: #999; }
.field .hint { margin: 0.15rem 0 0; }

.shortcuts { display: flex; flex-direction: column; gap: 0.6rem; margin: 1.5rem 0; }
.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions form { margin: 0; }

.crumbs { font-size: 0.9rem; color: #777; margin-bottom: 0.5rem; }
.crumbs a { color: #555; }

.rows { list-style: none; padding: 0; margin: 1rem 0; }
.rows li {
  background: #fff;
  border: 1px solid #e4e2dd;
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
}
.rows li.archived { opacity: 0.6; }
.row-title { font-weight: 600; }
.row-meta { color: #777; font-size: 0.9rem; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid #ccc;
  color: #555;
  vertical-align: middle;
}
.tag--active { border-color: #067647; color: #067647; }
.tag--archived { border-color: #999; color: #999; }

.link-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  background: #fff;
  border: 1px solid #e4e2dd;
  border-radius: 0.4rem;
  padding: 0.5rem 0.6rem;
}

.danger { border-color: #b42318; color: #b42318; background: #fff; }
