:root {
  --bg: #f3eee6;
  --paper: #fffdf8;
  --ink: #1d2a24;
  --muted: #6d756f;
  --line: #e4dbcf;
  --green: #1e5c43;
  --green-2: #2f7a58;
  --blush: #c97b84;
  --sand: #e8d7c0;
  --danger: #9b3a32;
  --ok: #1e5c43;
  --shadow: 0 18px 40px rgba(29, 42, 36, 0.08);
  --safe-t: var(--tg-content-safe-area-inset-top, var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)));
  --safe-b: var(--tg-content-safe-area-inset-bottom, var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  --font: "Manrope", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --bar: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

#app {
  min-height: 100dvh;
  padding-top: calc(var(--safe-t) + 44px);
  padding-bottom: calc(var(--safe-b) + 12px);
}

.to-neoroop {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.to-neoroop:hover { color: var(--green); }

.top {
  padding: 14px 18px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 36px; height: 36px; }
.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.admin-link {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  width: max-content;
}
.admin-link:hover { filter: brightness(1.08); }
.icon-btn, .back {
  border: 0;
  background: var(--paper);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cart-btn { position: relative; }
.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px 18px 14px;
}
.tab {
  border: 0;
  background: transparent;
  padding: 8px 4px;
  color: var(--muted);
  font-weight: 650;
}
.tab.is-on {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--green);
}

.grid {
  display: grid;
  gap: 12px;
  padding: 0 18px calc(var(--bar) + 18px);
}
.card {
  background: var(--paper);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 0;
  padding: 0;
  text-align: left;
  width: 100%;
}
.card img { height: 168px; width: 100%; object-fit: cover; }
.card__body { padding: 12px 14px 14px; }
.card h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 650;
}
.card .meta { margin: 0; color: var(--muted); font-size: 13px; }
.price {
  margin: 10px 0 0;
  font-weight: 800;
  font-size: 16px;
}

.screen { padding: 0 18px calc(var(--bar) + 24px); }
.hero {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero img { width: 100%; height: 240px; object-fit: cover; }
.screen h2 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 16px 0 6px;
  letter-spacing: -0.03em;
}
.lead { color: var(--muted); margin: 0 0 14px; }
.comp {
  background: #efe8dc;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 14px;
}

.sizes { display: grid; gap: 8px; margin: 0 0 16px; }
.size {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}
.size.is-on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.size b { display: block; }
.size span { color: var(--muted); font-size: 13px; }

.note-box textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--paper);
  resize: vertical;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 8px;
  font-weight: 650;
}
.check input { margin-top: 3px; accent-color: var(--green); }

.line {
  display: flex;
  gap: 12px;
  background: var(--paper);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.line img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.line h3 { margin: 0 0 4px; font-size: 16px; }
.line p { margin: 0; color: var(--muted); font-size: 13px; }
.qty {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.field { margin: 0 0 12px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 650;
}
.chip.is-on { background: var(--green); color: #fff; border-color: var(--green); }
.chip:disabled { opacity: 0.4; }

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.slot {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 10px;
  font-weight: 650;
}
.slot.is-on { border-color: var(--green); color: var(--green); }
.slot:disabled { opacity: 0.38; }

.summary {
  background: var(--paper);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin: 8px 0 16px;
}
.row { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; }
.row.total { font-weight: 800; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.warn {
  background: #f7e6d8;
  color: #6a3b1c;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 0 0 12px;
}

.demo-fill {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}
.demo-fill p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}
.demo-fill button {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 650;
}
.demo-fill button.is-copied {
  border-color: var(--green);
  color: var(--green);
}
.demo-fill__all {
  background: var(--green) !important;
  color: #fff !important;
  border-color: var(--green) !important;
  text-align: center !important;
}

.pay { display: grid; gap: 8px; margin-bottom: 16px; }
.pay button {
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.pay button.is-on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.pay small { display: block; color: var(--muted); margin-top: 4px; }

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 18px calc(10px + var(--safe-b));
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}
.bar button, .cta {
  width: 100%;
  border: 0;
  background: var(--green);
  color: #fff;
  border-radius: 16px;
  padding: 15px 16px;
  font-weight: 750;
  font-size: 16px;
}
.bar button:disabled, .cta:disabled { opacity: 0.45; }
.ghost {
  background: transparent;
  border: 0;
  color: var(--green);
  font-weight: 700;
  padding: 8px 0;
}

.done {
  text-align: center;
  padding: 48px 18px 24px;
}
.done .num {
  font-family: var(--serif);
  font-size: 40px;
  margin: 8px 0 12px;
}
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }

.pin {
  position: fixed;
  inset: 0;
  background: rgba(29, 42, 36, 0.45);
  display: grid;
  place-items: end center;
  z-index: 20;
}
.pin__card {
  width: 100%;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(18px + var(--safe-b));
}
.pin__dots { display: flex; justify-content: center; gap: 10px; margin: 12px 0 18px; }
.pin__dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
  display: block;
}
.pin__dots i.on { background: var(--green); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keys button {
  height: 52px;
  border: 0;
  background: var(--bg);
  border-radius: 14px;
  font-size: 20px;
  font-weight: 700;
}

.dock {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(10px + var(--safe-b));
  background: #1d2a24;
  color: #f6f1ea;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 6px;
  z-index: 5;
}
.dock button {
  border: 0;
  background: transparent;
  color: #c9cfc8;
  padding: 10px 6px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
}
.dock button.is-on { background: #2c4036; color: #fff; }

.err { color: var(--danger); font-size: 14px; margin: 0 0 10px; }
.busy { opacity: 0.6; pointer-events: none; }
