:root {
  --green: #1d4a38;
  --leaf: #1f7a45;
  --bg: #e5f2e3;
  --sheet: #f7fbf6;
  --card: #ffffff;
  --ink: #1c241f;
  --muted: #6e776f;
  --line: #e6efe6;
  --soft: #e7f6df;
  --amber: #f8f1d4;
  --sans: "Outfit", "Avenir Next", sans-serif;
  --serif: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; }
body.dash-body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); min-height: 100vh;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; }

.app {
  width: min(1280px, calc(100% - 28px));
  margin: 14px auto;
  min-height: calc(100vh - 28px);
  background: var(--sheet);
  border-radius: 28px;
  display: grid;
  grid-template-columns: 248px 1fr;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(30, 50, 30, .08);
  animation: rise .45s ease both;
}
.side {
  padding: 22px 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line);
  background: #fbfefb;
}
.side-close { display: none; }
.brand { display: flex; justify-content: center; padding: 4px 8px 16px; }
.brand img { height: 64px; width: auto; mix-blend-mode: multiply; }
.nav-btn, .logout {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: transparent; border-radius: 12px;
  padding: 11px 12px; font-weight: 600; font-size: 14.5px; color: #3d4741;
  cursor: pointer; text-align: left;
}
.nav-btn svg, .logout svg, .tabbar svg, .quick svg, .icon-btn svg { width: 18px; height: 18px; flex: none; }
.nav-btn:hover { background: #f3f8f2; }
.nav-btn.active { background: var(--soft); color: var(--green); }
.logout {
  margin-top: auto; border: 1px solid #e4ece4; background: #fff; justify-content: flex-start;
}
.logout:hover { border-color: var(--green); color: var(--green); }

.main { padding: 26px 28px 36px; min-width: 0; }
.hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.hello h1 { font-size: clamp(34px, 3vw, 44px); }
.hello p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 700; padding-top: 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #d7ead4; color: var(--green);
  display: grid; place-items: center; font-weight: 700;
}
.mobile-bar { display: none; }

.quicks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 16px; }
.quick {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; text-align: left; cursor: pointer;
  box-shadow: 0 8px 18px rgba(30, 50, 30, .04);
  animation: rise .55s both;
}
.quick:nth-child(2) { animation-delay: .05s; }
.quick:nth-child(3) { animation-delay: .1s; }
.quick:nth-child(4) { animation-delay: .15s; }
.quick:hover { transform: translateY(-2px); }
.quick b { display: block; font-size: 15px; }
.quick small { color: var(--muted); font-size: 12.5px; }
.bubble {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
}
.bubble.a { background: #e7f6df; color: #1d4a38; }
.bubble.b { background: #e7f3ea; color: #2f6b45; }
.bubble.c { background: #f8f3df; color: #8a6a16; }
.bubble.d { background: #fdecd9; color: #c26a1a; }
.bubble svg { width: 20px; height: 20px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px 8px; margin-top: 14px;
  box-shadow: 0 8px 18px rgba(30, 50, 30, .03);
  animation: rise .6s .08s both;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.panel-head h2 { font-family: var(--sans); font-size: 18px; font-weight: 700; letter-spacing: 0; }
.linkish { border: 0; background: transparent; color: var(--leaf); font-weight: 700; cursor: pointer; font-size: 13.5px; }

.order-row, .pay-row {
  display: grid; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid #f0f4f0;
}
.order-row { grid-template-columns: 1.5fr .45fr .7fr .7fr auto; }
.pay-row { grid-template-columns: 1fr auto auto; }
.prod { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prod img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #f3f7f2; }
.prod b { display: block; font-size: 14.5px; }
.prod small, .muted { color: var(--muted); font-size: 12.5px; }
.mprice { display: none; }
.price { font-weight: 750; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start;
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: #e5f6df; color: #1d7a45; }
.pill.wait { background: var(--amber); color: #8a6a16; }
.track, .ghost {
  border: 1px solid #e3ebe3; background: #fff; border-radius: 999px;
  padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.track:hover, .ghost:hover { border-color: var(--green); color: var(--green); }
.track { justify-self: start; }
.empty { color: var(--muted); padding: 16px 0 20px; }
.empty a { color: var(--leaf); font-weight: 700; }

.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; align-items: stretch; }
.refer {
  margin-top: 14px; border-radius: 18px; background: #eef8ea; border: 1px solid #e0f0dc;
  padding: 18px; position: relative; overflow: hidden; min-height: 210px;
  animation: rise .6s .12s both;
}
.refer h2 { font-family: var(--sans); font-size: 20px; font-weight: 750; letter-spacing: 0; }
.refer p { margin: 6px 0 14px; color: #3e4a42; max-width: 28ch; }
.code {
  display: flex; align-items: center; justify-content: space-between;
  width: min(220px, 100%); background: #fff; border-radius: 12px; padding: 10px 12px;
  font-weight: 800; letter-spacing: .04em; margin-bottom: 12px;
}
.code button { border: 0; background: transparent; cursor: pointer; color: #5d675f; display: grid; }
.share {
  border: 0; background: var(--green); color: #fff; border-radius: 999px;
  padding: 11px 16px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.share:hover { background: #16392c; }
.gift { position: absolute; right: 8px; bottom: 0; width: 150px; height: 140px; pointer-events: none; }

.recs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding-bottom: 12px; }
.rec {
  background: #fbfefb; border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 12px;
  position: relative; cursor: pointer;
}
.rec .heart {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fff;
  display: grid; place-items: center; cursor: pointer; color: #3a403c;
}
.rec .heart.on { color: #1d4a38; }
.rec .heart svg { width: 16px; height: 16px; }
.rec img { width: 100%; height: 120px; object-fit: cover; border-radius: 12px; background: #f3f7f2; }
.rec b { display: block; margin: 8px 4px 0; font-size: 14px; }
.rec small { display: block; margin: 0 4px; color: var(--muted); }
.rec .foot { display: flex; align-items: center; justify-content: space-between; margin: 8px 4px 0; }
.rec .foot strong { font-size: 15px; }
.add {
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--leaf); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.add:hover { transform: scale(1.06); }
.add.pop { animation: pop .35s ease; }
.add svg { width: 16px; height: 16px; }

.view[hidden] { display: none; }
.form { display: grid; gap: 10px; max-width: 460px; padding-bottom: 16px; }
.form label { font-size: 13px; font-weight: 700; }
.form input, .form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff;
}
.form textarea { min-height: 80px; resize: vertical; }
.save {
  border: 0; background: var(--green); color: #fff; border-radius: 12px; height: 46px;
  font-weight: 700; cursor: pointer;
}
.addr { padding: 12px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.addr .note { margin: 4px 0 0; }
.pill.bad { background: #fdecea; color: #a1301f; }
.order-row.track-card { grid-template-columns: 1fr; gap: 6px; }
.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.track-head b { font-size: 14.5px; overflow-wrap: anywhere; }
.track-card .note { margin: 4px 0; }
.track-card .cancel { justify-self: start; margin-top: 4px; color: #a1301f; }
.ghost:disabled, .add:disabled, .save:disabled { opacity: .55; cursor: not-allowed; }
.form-title { font-family: var(--sans); font-size: 17px; font-weight: 700; letter-spacing: 0; margin-top: 14px; }
#admin-link { text-decoration: none; }
.nav-btn[hidden] { display: none; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.step { font-size: 12px; color: #9aa29b; font-weight: 700; }
.step.on { color: var(--leaf); }
.note { color: var(--muted); font-size: 14px; line-height: 1.5; }
.help-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0 16px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--green); color: #fff; border-radius: 999px; padding: 10px 16px;
  font-weight: 700; opacity: 0; pointer-events: none; transition: .25s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tabbar { display: none; }
.scrim { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(.9); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .app, .quick, .panel, .refer, .add.pop { animation: none; }
}

@media (max-width: 980px) {
  body.dash-body { background: var(--sheet); }
  .app { width: 100%; margin: 0; border-radius: 0; min-height: 100vh; display: block; box-shadow: none; }
  .side {
    display: none; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40;
    box-shadow: 12px 0 40px rgba(20,30,20,.12);
  }
  .side.open {
    display: flex; overflow: auto;
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .side-close {
    display: grid; place-items: center; margin-left: auto;
    width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: #fff; color: var(--green); font-size: 26px; line-height: 1; cursor: pointer;
  }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(20,28,22,.35); z-index: 35; border: 0; }
  .scrim.open { display: block; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
  }
  .mobile-bar img { height: 48px; mix-blend-mode: multiply; }
  .icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; }
  .main { padding: 16px 16px 96px; }
  .who.desk { display: none; }
  .quicks { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .recs { display: flex; overflow: auto; gap: 10px; scroll-snap-type: x mandatory; }
  .rec { min-width: 168px; scroll-snap-align: start; }
  .order-row:has(.prod) {
    grid-template-columns: 1fr auto;
    grid-template-areas: "prod pill" "track track";
  }
  .order-row:not(:has(.prod)) { grid-template-columns: 1fr; }
  .order-row .prod { grid-area: prod; }
  .order-row .pill { grid-area: pill; justify-self: end; align-self: start; }
  .order-row .track { grid-area: track; justify-self: start; }
  .col-date, .col-price { display: none; }
  .mprice { display: inline; }
  .prod small .mprice::before { content: " · "; }
  .pay-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .steps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .step { background: #f3f7f2; border-radius: 999px; padding: 6px 8px; text-align: center; }
  #wishes { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  #wishes .rec { min-width: 0; }
  body.dash-body { overflow-x: hidden; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 48px; font-size: 11px; font-weight: 650; color: #667068; cursor: pointer;
  }
  .tabbar .active { color: var(--green); }
  .gift { width: 110px; opacity: .9; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .main { padding: 16px 16px calc(108px + env(safe-area-inset-bottom)); }
  .hello h1 { font-size: 30px; }
  .quick { min-width: 0; padding: 12px; }
  .quick > span { min-width: 0; }
  .quick b, .prod b, .rec b { overflow-wrap: break-word; }
  .form { max-width: none; }
  .form input, .form textarea { font-size: 16px; }
  .help-card { flex-direction: column; align-items: flex-start; }
  .help-card .share { min-height: 46px; }
  @media (max-width: 360px) {
    .quick { flex-direction: column; align-items: flex-start; gap: 8px; }
    .quick b { font-size: 14px; }
  }
  .refer .gift { width: 88px; opacity: .55; }
  .order-row .track, .pay-row .track { min-height: 40px; }
  .mobile-bar { padding-top: env(safe-area-inset-top); }
  .mobile-bar img { height: 44px; max-width: 148px; object-fit: contain; object-position: left center; }
}
