body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}
button, input { font: inherit; }
.bar .clear-btn {
  flex: none; height: 36px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: #B42318; font-weight: 700; cursor: pointer;
}
.bar .clear-btn[hidden] { display: none; }
.page { max-width: 720px; margin: 0 auto; padding: 8px 0 24px; }
.state {
  margin: 24px 16px; padding: 28px 20px; border-radius: 16px; background: #fff;
  text-align: center; border: 1px solid var(--line);
}
.state[hidden], #cart-list[hidden], #cart-checkout[hidden] { display: none; }
.group {
  margin: 0 0 10px; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) {
  .page { padding: 8px 8px 24px; }
  .group { border-radius: 14px; border: 1px solid var(--line); }
}
.group-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.group-head input { width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.group-head .seller { flex: 1; min-width: 0; font-weight: 800; }
.group-head .chat, .group-head .rm-group {
  flex: none; border: 0; background: transparent; color: var(--teal);
  font-weight: 700; font-size: 13px; cursor: pointer; padding: 6px 4px;
}
.group-head .rm-group { color: #B42318; }
.ship-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 14px; background: #F7FBFA; border-bottom: 1px solid var(--line);
}
.ship-chip {
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid #E3EBE9; background: #fff; font-weight: 700; font-size: 12px; cursor: pointer;
}
.ship-chip.on { border-color: var(--teal); color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, #fff); }
.ship-pick {
  width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--teal); font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px 0;
}
.ship-meta { width: 100%; color: var(--muted); font-size: 12px; }
.line {
  display: grid; grid-template-columns: 72px 1fr; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.line:last-child { border-bottom: 0; }
.line img, .line .ph {
  width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #E7EEEC;
}
.line .ph { display: grid; place-items: center; font-size: 24px; }
.line .meta { min-width: 0; }
.line .name {
  font-weight: 700; font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.line .attrs { margin-top: 2px; color: var(--muted); font-size: 12px; }
.line .price { margin-top: 4px; color: var(--orange); font-weight: 800; }
.line .ops {
  margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.qty {
  display: inline-flex; align-items: center; border: 1.5px solid #E3EBE9; border-radius: 10px; overflow: hidden;
}
.qty button {
  width: 32px; height: 32px; border: 0; background: #F7FBFA; cursor: pointer; font-weight: 800;
}
.qty button:disabled { opacity: .4; cursor: default; }
.qty span { min-width: 28px; text-align: center; font-weight: 700; font-size: 13px; }
.line .del {
  border: 0; background: transparent; color: #B42318; font-weight: 700; font-size: 13px; cursor: pointer;
}
.group-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; font-size: 13px; color: var(--muted);
}
.group-foot strong { color: var(--ink); }
#cart-checkout {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.checkout-inner {
  max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
}
.checkout-sum { flex: 1; min-width: 0; }
.checkout-sum small { display: block; color: var(--muted); font-size: 12px; }
.checkout-sum strong { color: var(--orange); font-size: 16px; }
.checkout-btn {
  flex: none; height: 46px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--orange); color: #fff; font-weight: 800; cursor: pointer;
}
.checkout-btn:disabled { opacity: .55; cursor: default; }
.sheet {
  position: fixed; inset: 0; z-index: 40; display: none; align-items: flex-end; justify-content: center;
}
.sheet.is-open { display: flex; }
.sheet-backdrop { position: absolute; inset: 0; border: 0; background: rgba(16,24,23,.4); cursor: pointer; }
.sheet-panel {
  position: relative; width: min(480px, 100%); max-height: min(88vh, 720px);
  overflow: auto; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; background: #fff;
  box-shadow: 0 -8px 28px rgba(16,24,23,.12);
}
.sheet-handle {
  display: block; width: 36px; height: 4px; margin: 4px auto 12px;
  border-radius: 999px; background: rgba(28,36,35,.16);
}
.sheet-panel h2 { margin: 0 0 10px; font-size: 17px; font-weight: 800; }
.sheet-sec { margin: 0 0 14px; }
.sheet-sec h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.addr-opt, .rate-opt {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 12px; margin: 0 0 8px; border: 1.5px solid #E3EBE9;
  border-radius: 12px; background: #fff; text-align: left; cursor: pointer;
}
.addr-opt { align-items: flex-start; }
.addr-opt.on, .rate-opt.on { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, #fff); }
.addr-opt strong, .rate-opt strong { display: block; font-size: 14px; }
.addr-opt span, .rate-opt span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.rate-opt .rate-logo {
  flex: none; width: 44px; height: 44px; border-radius: 10px;
  background: color-mix(in srgb, var(--orange) 10%, #fff);
  display: grid; place-items: center; overflow: hidden;
}
.rate-opt .rate-logo img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.rate-opt .rate-logo .ph {
  font-size: 11px; font-weight: 800; color: var(--orange);
  letter-spacing: .02em; text-transform: uppercase;
}
.rate-opt .rate-copy { flex: 1; min-width: 0; }
.rate-opt .rate-fee {
  flex: none; font-weight: 800; font-size: 14px; color: var(--ink);
  white-space: nowrap;
}
.sheet-apply {
  width: 100%; height: 48px; border: 0; border-radius: 12px;
  background: var(--teal); color: #fff; font-weight: 800; cursor: pointer;
}
.sheet-apply:disabled { opacity: .55; }
.sheet-empty { padding: 12px 0; color: var(--muted); font-size: 13px; }
body.has-cart-checkout .bottom-nav { display: none; }
@media (min-width: 1100px) {
  body.has-cart-checkout { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}
