:root {
  --gold: #C0A468;
  --gold-deep: #8E6C31;
  --gold-soft: #FBF5EA;
  --ink: #33302B;
  --sub: #8C877E;
  --line: #EFE9DF;
  --cream: #FAF7F2;
  --card: #fff;
  --danger: #C4503E;
  --ok: #3E8B62;
  --lilac: #C6BCE2;
  --shadow: 0 10px 30px rgba(80, 60, 30, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--cream);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.loading, .fail { padding: 28vh 24px 0; text-align: center; color: var(--sub); }
.fail .sub { font-size: 13px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: #33302B;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 20;
  max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.customer { background: #E8E1D6; }
.customer #toast { bottom: 96px; }
.wrap {
  width: min(480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--cream);
  padding-bottom: 28px;
}
.hero, .block { padding: 22px 20px 0; }
.logo { height: 46px; width: auto; }
.tagline { margin: 14px 0 0; font-size: 16px; line-height: 1.6; }
.storeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.storeline > div { display: flex; flex-direction: column; gap: 2px; }
.storeline strong { font-size: 20px; font-weight: 650; }
.storeline span, .quiet { color: var(--sub); font-size: 13px; }
.linkish {
  flex: none;
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--gold-deep);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
}

.cats {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  background: rgba(250, 247, 242, .94);
  backdrop-filter: blur(8px);
  overflow-x: auto;
}
.cats button, .filters button, .chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--sub);
  white-space: nowrap;
}
.cats button.on, .filters button.on, .chip.on {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-deep);
  font-weight: 650;
}

.list { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 96px; }
.card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  background: var(--card);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.card.sold { opacity: .62; }
.mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 650;
  overflow: hidden;
}
.mark.photo img { width: 100%; height: 100%; object-fit: cover; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.title-row h3 { flex: 1; min-width: 0; }
.card h3 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.35; }
.card p { margin: 4px 0 0; color: var(--sub); font-size: 13px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.tag, .badge {
  font-style: normal;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--gold-soft);
  color: var(--gold-deep);
}
.badge.sold { background: #F8E6E2; color: var(--danger); }
.badge.low { background: #F8EFE3; color: #8A6244; }
.stepper { flex: none; display: flex; align-items: center; gap: 8px; }
.stepper button, .plus {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: var(--gold-deep);
  color: #fff;
  line-height: 30px;
  text-align: center;
  font-size: 20px;
}
.stepper b { min-width: 12px; text-align: center; font-weight: 650; }

.cartbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
}
.cartbar p { margin: 0; font-size: 14px; }
.primary, .ghost, .danger {
  border-radius: 999px;
  height: 44px;
  padding: 0 18px;
  border: 0;
}
.primary { background: var(--gold-deep); color: #fff; font-weight: 650; }
.ghost { background: #fff; color: var(--gold-deep); border: 1px solid var(--gold); }
.danger { background: #fff; color: var(--danger); border: 1px solid #F0D0CA; height: 36px; }
.wide { width: 100%; height: 48px; font-size: 16px; }

.back { margin: 8px 0 0; }
.sheet h2, .status h2 { margin: 8px 0 0; font-size: 22px; }
.chosen { margin-top: 16px; background: #fff; border-radius: 16px; padding: 8px 14px; }
.chosen div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.chosen div:last-child { border-bottom: 0; }
.field { margin-top: 18px; }
.field span { display: block; font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.field em { font-style: normal; font-weight: 450; color: var(--sub); }
.field input, .field textarea, .admin input, .admin select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}
.field textarea { min-height: 72px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hint { margin: 8px 0 0; color: var(--sub); font-size: 12px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 14px 0 8px; }
.promise {
  margin: 10px 0 0;
  text-align: center;
  color: var(--sub);
  font-size: 12px;
}

.pick-list { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 32px; }
.pick-list button {
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  font-size: 17px;
}
.kily-mini { width: 92px; margin: 18px auto 0; }

.status { text-align: center; padding: 28px 20px 40px; }
.kily {
  width: 148px;
  height: 148px;
  margin: 8px auto 0;
  display: grid;
  place-items: center;
  position: relative;
}
.kily img { width: 148px; height: auto; }
.kily.pending::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  animation: halo 1.8s ease-out infinite;
}
.kily.making { animation: float 2.6s ease-in-out infinite; }
.kily .steam {
  display: none;
  position: absolute;
  left: 50%;
  top: 8px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: rgba(169, 203, 226, .9);
}
.kily.making .steam { display: block; animation: steam 1.5s ease-in infinite; }
.kily.making .steam.b { margin-left: 10px; animation-delay: .4s; }
.kily.making .steam.c { margin-left: -16px; animation-delay: .8s; }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes halo { to { transform: scale(1.18); opacity: 0; } }
@keyframes steam { to { transform: translateY(-22px); opacity: 0; } }

.pickup { margin: 18px 0 0; font-size: 36px; letter-spacing: .04em; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.steps { display: flex; justify-content: center; gap: 18px; margin: 16px 0; padding: 0; list-style: none; color: var(--sub); font-size: 13px; }
.steps .on { color: var(--gold-deep); font-weight: 650; }
.detail { text-align: left; background: #fff; border-radius: 16px; padding: 8px 14px; margin-top: 8px; }
.detail div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail div:last-child { border-bottom: 0; }
.detail span { color: var(--sub); }

.admin { background: #F3EEE6; }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.admin .logo { height: 40px; }
.top h1 { margin: 8px 0 0; font-size: 22px; font-weight: 650; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tools select, .login-card input { width: auto; min-width: 140px; }
.pill { font-size: 12px; color: var(--sub); background: #fff; border-radius: 999px; padding: 6px 10px; }
.tabs, .filters { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; color: var(--sub); padding: 8px 2px; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-color: var(--gold-deep); font-weight: 650; }
.counts { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.counts b { background: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 650; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.order {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.order header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order header strong { font-size: 18px; letter-spacing: .03em; }
.order .who { margin: 8px 0; font-size: 15px; }
.order .lines { margin: 0; padding: 0; list-style: none; color: var(--ink); font-size: 14px; }
.order .lines li { display: flex; justify-content: space-between; padding: 4px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions button { height: 36px; }
.order.cancelled { opacity: .55; }
.empty { color: var(--sub); background: #fff; border-radius: 16px; padding: 28px; text-align: center; }

.menu-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.menu-row {
  display: grid;
  grid-template-columns: 56px 1.4fr .6fr .8fr 110px auto auto;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
}
.thumb, .thumb.fallback {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}
.thumb.fallback {
  display: grid;
  place-items: center;
  background: #F6E7D4;
  color: var(--gold-deep);
  font-weight: 650;
}
.file-btn { position: relative; overflow: hidden; height: 36px; padding: 0 12px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.daypick { display: flex; align-items: center; gap: 6px; color: var(--sub); font-size: 14px; }
.daypick input { width: auto; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: #fff; }
.record-note { margin: 0 0 12px; }
.menu-row .name small { display: block; color: var(--sub); font-size: 12px; margin-top: 3px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.menu-row input[type="number"] { width: 100%; }
.add-item { display: grid; grid-template-columns: 1.3fr .7fr 1.2fr auto auto; gap: 8px; margin: 0 0 14px; }
.add-item input, .add-item select { width: 100%; }

.tent {
  width: min(420px, 100%);
  margin: 8px auto;
  background: #fff;
  border-radius: 28px;
  padding: 28px 24px 32px;
  text-align: center;
  box-shadow: var(--shadow);
}
.tent h2 { margin: 8px 0; font-size: 28px; }
.tent .logo { margin: 0 auto; }
#qrbox { display: grid; place-items: center; min-height: 220px; margin: 8px 0; }
#qrbox img, #qrbox canvas { margin: 0 auto; }
.url { word-break: break-all; color: var(--sub); font-size: 13px; }
.tent-actions { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 22px; margin: 12px 0 6px; }
.login-card p { color: var(--sub); margin-top: 0; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 800px) {
  .menu-row, .add-item { grid-template-columns: 1fr 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .tools { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .customer { background: var(--cream); }
}
@media print {
  body.admin { background: #fff; }
  .top, .tabs, .tent-actions, .no-print { display: none !important; }
  .shell { width: auto; padding: 0; }
  .tent { box-shadow: none; }
}
