:root {
  color-scheme: light;
  --bg: #f7efe4;
  --bg-soft: #fff8ef;
  --surface: rgba(255, 251, 245, .82);
  --surface-strong: #fffaf3;
  --surface-flat: #ffffff;
  --ink: #241711;
  --muted: #7a6b5f;
  --faint: #a69384;
  --brand: #7b3f23;
  --brand-dark: #4c2414;
  --brand-2: #d6884e;
  --accent: #f3bd67;
  --ok: #167a4a;
  --danger: #b42318;
  --info: #2563eb;
  --border: rgba(119, 72, 42, .18);
  --border-strong: rgba(119, 72, 42, .32);
  --shadow-sm: 0 10px 24px rgba(58, 34, 20, .08);
  --shadow: 0 22px 70px rgba(58, 34, 20, .15);
  --shadow-brand: 0 18px 45px rgba(124, 63, 32, .22);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --focus: 0 0 0 4px rgba(214, 136, 78, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #160f0b;
    --bg-soft: #21140f;
    --surface: rgba(35, 23, 17, .82);
    --surface-strong: #241711;
    --surface-flat: #2c1c14;
    --ink: #fff7ef;
    --muted: #cfbcae;
    --faint: #ad9382;
    --brand: #f3a765;
    --brand-dark: #ffd0a0;
    --brand-2: #d6884e;
    --accent: #ffd284;
    --border: rgba(255, 215, 184, .16);
    --border-strong: rgba(255, 215, 184, .28);
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, .22);
    --shadow: 0 28px 80px rgba(0, 0, 0, .36);
    --shadow-brand: 0 18px 45px rgba(243, 167, 101, .14);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 220, 164, .62), transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(214, 136, 78, .28), transparent 30%),
    linear-gradient(135deg, var(--bg-soft), var(--bg) 54%, #eadccc);
  overflow-x: hidden;
}
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(8px);
  opacity: .42;
  z-index: -1;
}
body::before {
  width: 380px;
  height: 380px;
  right: -160px;
  top: 150px;
  background: radial-gradient(circle, rgba(123, 63, 35, .24), transparent 68%);
}
body::after {
  width: 310px;
  height: 310px;
  left: -120px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(243, 189, 103, .34), transparent 70%);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-strong), transparent 10%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 900;
  letter-spacing: -.03em;
  font-size: 18px;
}
.logo-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.42), transparent 22%),
    linear-gradient(145deg, var(--brand-dark), var(--brand-2));
  color: white;
  box-shadow: var(--shadow-brand);
}
.logo-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--muted);
}

.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav a,
.nav button,
.btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-flat), transparent 6%);
  color: var(--ink);
  padding: 11px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 850;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(58, 34, 20, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.nav a:hover,
.nav button:hover,
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.nav a.active,
.nav a[aria-current="page"],
.btn.primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-2));
  box-shadow: var(--shadow-brand);
}
.btn.ghost { background: transparent; box-shadow: none; }
.btn.soft { background: rgba(243, 189, 103, .18); color: var(--brand-dark); }
.btn.danger {
  border-color: rgba(180, 35, 24, .18);
  color: var(--danger);
  background: color-mix(in srgb, #fff1f0, var(--surface-flat) 28%);
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin: 18px 0 22px;
}
.page-intro p { max-width: 720px; margin: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-2);
}

.hero,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, .95fr);
  gap: 22px;
  align-items: stretch;
}
.hero { min-height: 520px; align-items: center; }
.hero-copy { padding: clamp(24px, 4vw, 48px); }
.hero-card-stack { display: grid; gap: 16px; align-content: center; }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.28), transparent 42%),
    radial-gradient(circle at top right, rgba(243, 189, 103, .16), transparent 42%);
  opacity: .8;
}
.card > * { position: relative; z-index: 1; }
.card.compact { padding: 18px; border-radius: var(--radius-lg); }
.card.flat { background: var(--surface-flat); }
.card.hero-copy { display: grid; align-content: center; }
.card.loyalty {
  color: white;
  background:
    radial-gradient(circle at 86% 10%, rgba(255,255,255,.22), transparent 24%),
    linear-gradient(145deg, #4b2415, #8d4726 54%, #d5894f);
  border-color: rgba(255, 255, 255, .22);
}
.card.loyalty p,
.card.loyalty .muted { color: rgba(255,255,255,.78); }
.card.loyalty .badge { color: white; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.24); }
.card.loyalty .progress-wrap { background: rgba(255,255,255,.2); }
.card.loyalty .progress-bar { background: linear-gradient(90deg, #fff2be, #ffffff); }
.card.loyalty .btn:not(.primary) { background: rgba(255,255,255,.13); color: white; border-color: rgba(255,255,255,.2); box-shadow: none; }
.card.loyalty .btn.primary { background: #fff; color: #5a2b19; }

h1, h2, h3 { margin: 0 0 12px; line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(34px, 6.2vw, 68px); max-width: 900px; }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 18px; letter-spacing: -.02em; }
p { color: var(--muted); line-height: 1.6; }
.lead { font-size: clamp(17px, 2.2vw, 21px); max-width: 730px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 14px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.metric {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-flat), transparent 2%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px rgba(58, 34, 20, .06);
  overflow: hidden;
}
.metric::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  right: -24px;
  top: -28px;
  border-radius: 999px;
  background: rgba(214, 136, 78, .16);
}
.metric .value {
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.05em;
}
.metric .label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.feature-list { display: grid; gap: 12px; margin-top: 18px; }
.feature {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-flat), transparent 8%);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(214, 136, 78, .14);
}
.feature strong { display: block; margin-bottom: 3px; }
.feature p { margin: 0; font-size: 14px; }

.coffee-visual {
  min-height: 420px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.coffee-card {
  width: min(360px, 100%);
  border-radius: 34px;
  padding: 24px;
  color: white;
  background:
    radial-gradient(circle at 22% 16%, rgba(255,255,255,.24), transparent 22%),
    linear-gradient(145deg, #32150c, #7b3f23 56%, #d6884e);
  box-shadow: 0 34px 90px rgba(84, 43, 23, .33);
  transform: rotate(-2deg);
}
.coffee-card .big-cup {
  width: 120px;
  height: 120px;
  margin: 12px auto 22px;
  display: grid;
  place-items: center;
  border-radius: 40px;
  background: rgba(255,255,255,.15);
  font-size: 62px;
}
.coffee-card .mini-progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.22);
}
.coffee-card .mini-progress span { display: block; width: 72%; height: 100%; background: #fff2be; }
.steam {
  position: absolute;
  width: 130px;
  height: 130px;
  right: 14%;
  top: 16%;
  border: 1px solid rgba(255,255,255,.38);
  border-right: 0;
  border-bottom: 0;
  border-radius: 999px;
  opacity: .48;
}

.progress-wrap {
  margin: 18px 0 10px;
  background: color-mix(in srgb, var(--border), transparent 35%);
  border-radius: 999px;
  overflow: hidden;
  height: 18px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.06);
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-2), var(--accent));
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-flat), transparent 4%);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 880;
}
.badge.ok { border-color: rgba(22, 122, 74, .22); color: var(--ok); background: color-mix(in srgb, #f0fff7, var(--surface-flat) 24%); }
.badge.warn { border-color: rgba(243, 189, 103, .42); color: #925a00; background: color-mix(in srgb, #fff8e6, var(--surface-flat) 24%); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar > * { flex: 1 1 180px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  background: color-mix(in srgb, var(--surface-flat), transparent 1%);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: var(--focus); outline: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 850; }
textarea { min-height: 106px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-flat), transparent 2%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 14px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 950; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; transition: background .18s ease; }
tr.clickable:hover { background: rgba(214, 136, 78, .10); }

.qr-box { text-align: center; }
.qr-frame {
  width: min(280px, 100%);
  margin: 16px auto;
  padding: 18px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 48px rgba(58, 34, 20, .10);
}
.qr-box img { width: 100%; height: auto; display: block; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: color-mix(in srgb, var(--surface-flat), transparent 4%);
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.notice,
.error {
  border-radius: var(--radius-md);
  padding: 13px 15px;
  margin: 12px 0;
  line-height: 1.55;
}
.notice { border: 1px solid rgba(243, 189, 103, .42); background: color-mix(in srgb, #fff8e6, var(--surface-flat) 24%); color: #7a4b00; }
.error { border: 1px solid rgba(180, 35, 24, .24); background: color-mix(in srgb, #fff1f0, var(--surface-flat) 25%); color: var(--danger); }
.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 16px;
  border-radius: 18px;
  color: white;
  background: #111827;
  box-shadow: var(--shadow);
  z-index: 30;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: .25s ease;
  font-weight: 800;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.danger { background: var(--danger); }

.mobile-only { display: none; }

@media (max-width: 920px) {
  .hero, .split, .page-intro, .grid.two, .grid.three, .grid.four, .form-row { grid-template-columns: 1fr; }
  .topbar { position: static; align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .coffee-visual { min-height: auto; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 12px; }
  .topbar { border-radius: 20px; }
  .card { padding: 18px; border-radius: 24px; }
  .nav a, .nav button, .btn { width: 100%; }
  .nav { width: 100%; display: grid; grid-template-columns: 1fr; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .toolbar { display: grid; }
  h1 { font-size: clamp(32px, 11vw, 48px); }
  table { min-width: 560px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

.card.loyalty .eyebrow { color: rgba(255,255,255,.78); }
.card.loyalty .eyebrow::before { background: rgba(255,255,255,.72); }
.card.loyalty label { color: rgba(255,255,255,.82); }
.card.loyalty input,
.card.loyalty select,
.card.loyalty textarea { background: rgba(255,255,255,.94); color: #241711; border-color: rgba(255,255,255,.28); }
.card.loyalty .table-wrap { color: var(--ink); background: var(--surface-flat); }
.card.loyalty .btn.danger { background: #fff1f0; color: #b42318; border-color: rgba(180, 35, 24, .24); }
