/* ── Feed-store ticket design system ─────────────────────────────────── */
:root {
  --paper: #f6efdd;
  --paper-2: #efe5cb;
  --kraft: #e4d6b4;
  --ink: #2b2317;
  --ink-soft: #6b5d45;
  --green: #2f5d3a;
  --green-dark: #1f4028;
  --red: #a83c28;
  --wheat: #d9a441;
  --stamp-red: #b8442d;
  --radius: 10px;
  --shadow: 0 2px 0 rgba(43, 35, 23, 0.18), 0 12px 28px rgba(43, 35, 23, 0.16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Bitter', Georgia, serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
}

/* grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, .display {
  font-family: 'Staatliches', 'Bitter', sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0;
}

.num { font-variant-numeric: tabular-nums; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  font-family: 'Staatliches', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn-green { background: var(--green); border-color: var(--green-dark); color: #f6efdd; box-shadow: 0 3px 0 var(--green-dark); }
.btn-red { background: var(--red); border-color: #7c2b1c; color: #f6efdd; box-shadow: 0 3px 0 #7c2b1c; }
.btn-ghost { background: transparent; box-shadow: none; border: 2px dashed var(--ink-soft); color: var(--ink-soft); }
.btn-ghost:active { transform: none; }
.btn-big { font-size: 1.5rem; padding: 16px 24px; width: 100%; }
.btn-sm { font-size: 0.95rem; padding: 6px 12px; box-shadow: 0 2px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ── forms ───────────────────────────────────────────────────────────── */
input[type='text'], input[type='password'], input[type='number'], input[type='date'], select {
  font-family: 'Bitter', serif;
  font-size: 1rem;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus { outline: 3px solid var(--wheat); outline-offset: 1px; }
label { font-family: 'Staatliches', sans-serif; letter-spacing: 0.06em; font-size: 0.95rem; color: var(--ink-soft); display: block; margin-bottom: 4px; }

/* ── cards / layout ──────────────────────────────────────────────────── */
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.card {
  background: #fbf6e9;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.88rem; }

.divider { border: 0; border-top: 2px dashed var(--kraft); margin: 14px 0; }

/* ── header band ─────────────────────────────────────────────────────── */
.band {
  background: var(--green);
  color: var(--paper);
  border-bottom: 4px solid var(--green-dark);
  padding: 14px 16px;
}
.band h1 { font-size: 1.6rem; color: var(--paper); }
.band .sub { font-size: 0.85rem; opacity: 0.85; font-family: 'Bitter', serif; }

/* ── stamp ───────────────────────────────────────────────────────────── */
.stamp {
  display: inline-block;
  font-family: 'Staatliches', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  color: var(--stamp-red);
  border: 3px solid var(--stamp-red);
  border-radius: 6px;
  padding: 2px 12px;
  transform: rotate(-4deg);
  opacity: 0.9;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='3'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 .3 1 1 1 1 1'/%3E%3C/feComponentTransfer%3E%3CfeComposite in2='SourceGraphic' operator='in'/%3E%3C/filter%3E%3Crect width='120' height='40' fill='%23fff' filter='url(%23r)'/%3E%3C/svg%3E");
  mask-size: cover;
}
.stamp.green { color: var(--green); border-color: var(--green); }
.stamp.wheat { color: #9a6f1d; border-color: #9a6f1d; }

/* ── tags / pills ────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: 'Staatliches', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  background: var(--kraft);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--ink-soft);
}

/* ── qty stepper ─────────────────────────────────────────────────────── */
.stepper { display: flex; align-items: center; gap: 0; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: #fffdf6; }
.stepper button {
  font-family: 'Staatliches', sans-serif;
  font-size: 1.4rem;
  width: 44px; height: 44px;
  border: 0; background: var(--paper-2); color: var(--ink);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.stepper button:active { background: var(--wheat); }
.stepper .qty { width: 44px; text-align: center; font-weight: 700; font-size: 1.1rem; }

/* ── toast ───────────────────────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  font-family: 'Staatliches', sans-serif; letter-spacing: 0.06em;
  padding: 10px 20px; border-radius: 999px;
  opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 1000;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; }

/* ── tabs (admin) ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; padding: 10px 12px 0; background: var(--green); overflow-x: auto; }
.tabs button {
  font-family: 'Staatliches', sans-serif; font-size: 1.05rem; letter-spacing: 0.05em;
  border: 2px solid var(--green-dark); border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--green-dark); color: #cfe0d2;
  padding: 8px 16px; cursor: pointer; white-space: nowrap;
}
.tabs button.on { background: var(--paper); color: var(--ink); border-color: var(--green-dark); }

/* list rows */
.lrow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 2px dashed var(--kraft);
}
.lrow:last-child { border-bottom: 0; }
.lrow .grow { flex: 1; min-width: 0; }
.lrow .name { font-weight: 700; }

@media (min-width: 600px) { .band h1 { font-size: 2rem; } }
