:root {
  color-scheme: light;
  --bg: #f8f4ec;
  --surface: #fffdf8;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d9c8ad;
  --brand: #b84b3a;
  --brand-dark: #933727;
  --green: #176f63;
  --gold: #a76b19;
  --soft-green: #e9f4ef;
  --soft-red: #fbebe7;
  --soft-gold: #fff4d5;
  --warm-panel: rgba(255, 253, 248, 0.9);
  --shadow: 0 18px 48px rgba(42, 32, 22, 0.16);
  --shop-shadow: 0 12px 32px rgba(76, 50, 24, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 244, 236, 0.96)),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p {
  margin-top: 0;
}

.gate-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.gate-panel {
  width: min(390px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.gate-panel.narrow {
  width: min(390px, 100%);
}

.cu-auth-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-items: center;
  overflow: hidden;
  padding: 12px 0;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 216, 57, 0.28), transparent 26%),
    radial-gradient(circle at 82% 8%, rgba(255, 117, 31, 0.2), transparent 25%),
    linear-gradient(180deg, #fff7df 0%, #fff1eb 44%, #f8f4ec 100%);
}

.cu-auth-page::before {
  content: "";
  position: absolute;
  inset: -20% -15% auto;
  height: 46vh;
  background:
    linear-gradient(135deg, rgba(255, 205, 41, 0.55), rgba(255, 117, 31, 0.38)),
    #f37b1d;
  border-radius: 0 0 48% 48%;
  transform: rotate(-3deg);
}

.cu-auth-title {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1678 / 724;
  object-fit: contain;
  margin: -2px auto 8px;
  filter: drop-shadow(0 10px 18px rgba(117, 68, 10, 0.18));
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.cu-auth-card {
  position: relative;
  z-index: 1;
  width: min(490px, calc(100% - 10px));
  margin: 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 48px rgba(136, 79, 28, 0.18);
  overflow: hidden;
}

.bg-red {
  background: #e54d42;
}

.bg-orange {
  background: #f37b1d;
}

.bg-green {
  background: #39b54a;
}

.cu-auth-form {
  display: grid;
  gap: 18px;
  padding: 22px 20px 24px;
}

.cu-form-block {
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(217, 200, 173, 0.78);
  padding: 16px;
}

.cu-form-block legend,
.cu-form-block > span {
  display: block;
  margin: 0 0 12px;
  color: #8a6b4d;
  font-size: 14px;
  font-weight: 900;
}

.cu-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cu-segment-option {
  position: relative;
  display: grid;
  min-height: 56px;
  place-items: center;
  border-radius: 999px;
  background: #f8f4ec;
  color: #6b4f36;
  font-size: 16px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.cu-segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cu-segment-option:has(input:checked) {
  background: linear-gradient(135deg, #f37b1d, #fbbd08);
  color: #fff;
  box-shadow: 0 10px 22px rgba(243, 123, 29, 0.32);
  transform: translateY(-1px);
}

.cu-input-group input {
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: #f8f4ec;
  box-shadow: none;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 800;
}

.cu-input-group input:focus {
  box-shadow: 0 0 0 3px rgba(243, 123, 29, 0.16);
}

.cu-btn-gradual {
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f37b1d, #e54d42);
  color: #fff;
  box-shadow: 0 12px 24px rgba(229, 77, 66, 0.3);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cu-btn-gradual:hover,
.cu-btn-gradual:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(229, 77, 66, 0.35);
}

.cu-message {
  border-radius: 8px;
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 900;
}

.cu-message.error {
  background: #fff1f0;
  color: #e54d42;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.gate-panel h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.12;
}

.gate-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.identity-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.identity-option {
  position: relative;
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.identity-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.identity-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--soft-red);
  color: var(--brand-dark);
}

.animation-fade {
  animation: cu-fade 0.8s linear both;
}

.animation-slide-bottom {
  animation: cu-slide-bottom 0.5s ease-out both;
}

@keyframes cu-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cu-slide-bottom {
  from {
    opacity: 0;
    transform: translateY(48px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 10px 12px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 111, 99, 0.14);
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.primary-button:active,
.secondary-button:active,
.text-button:active,
.category:active,
.cart-button:active {
  transform: translateY(1px) scale(0.99);
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #e65a42, #f4a62a);
  color: #fff;
  box-shadow: 0 10px 22px rgba(184, 75, 58, 0.22);
}

.primary-button:hover {
  background: linear-gradient(135deg, #d94a32, #ef9416);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.text-button {
  border: 1px solid rgba(23, 111, 99, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: var(--green);
}

.flash {
  border-radius: 8px;
  margin: 16px 0 0;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
}

.flash.error {
  background: var(--soft-red);
  color: var(--brand-dark);
}

.shop-shell,
.admin-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 20px 14px 104px;
}

.shop-shell {
  position: relative;
  z-index: 0;
}

.shop-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 196, 69, 0.24), transparent 26%),
    radial-gradient(circle at 92% 18%, rgba(57, 181, 74, 0.14), transparent 24%),
    linear-gradient(180deg, #fff9e8 0%, #fff3ea 44%, #f5f2e8 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(217, 200, 173, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 213, 0.88));
  box-shadow: var(--shop-shadow);
  padding: 14px 14px 13px;
  backdrop-filter: blur(10px);
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.wallet-button strong {
  margin-left: 4px;
  color: var(--gold);
}

.cart-button {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 18;
  display: grid;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #e65a42, #f4a62a);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(184, 75, 58, 0.34);
}

.cart-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.cart-button strong {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #176f63;
  color: #fff;
  box-shadow: 0 6px 14px rgba(23, 111, 99, 0.22);
  font-size: 12px;
  line-height: 1;
  padding: 0 6px;
}

.order-board {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 12px;
}

.catalog-search {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(217, 200, 173, 0.68);
  border-radius: 8px;
  background: var(--warm-panel);
  box-shadow: 0 10px 26px rgba(76, 50, 24, 0.08);
  padding: 10px;
  backdrop-filter: blur(8px);
}

.catalog-search label {
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.search-field {
  position: relative;
  min-width: 0;
}

.search-field input {
  height: 44px;
  border-color: rgba(217, 200, 173, 0.86);
  background: rgba(255, 255, 255, 0.92);
  padding-right: 44px;
  font-weight: 800;
}

.search-field input::-webkit-search-cancel-button {
  appearance: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(217, 200, 173, 0.76);
  border-radius: 8px;
  background: #fff8ec;
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1;
  transform: translateY(-50%);
}

.catalog-search p {
  min-width: 112px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.categories {
  position: sticky;
  top: 14px;
  align-self: start;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(217, 200, 173, 0.68);
  border-radius: 8px;
  background: var(--warm-panel);
  box-shadow: 0 10px 26px rgba(76, 50, 24, 0.08);
  padding: 8px;
  backdrop-filter: blur(8px);
}

.category {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(217, 200, 173, 0.4);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.category.active {
  border-color: transparent;
  background: linear-gradient(135deg, #23a57d, #f4b23f);
  color: #fff;
  box-shadow: 0 10px 20px rgba(23, 111, 99, 0.18);
  transform: translateY(-1px);
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 13px;
}

.search-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(217, 200, 173, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.84);
  padding: 28px 16px;
  text-align: center;
}

.search-empty h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.search-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.product-card,
.admin-order,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 128px;
  overflow: hidden;
  padding: 8px;
  border-color: rgba(217, 200, 173, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 235, 0.96));
  box-shadow: 0 10px 24px rgba(76, 50, 24, 0.1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.product-card:active {
  transform: scale(0.995);
}

@media (hover: hover) {
  .product-card:hover {
    border-color: rgba(244, 178, 63, 0.82);
    box-shadow: 0 14px 30px rgba(76, 50, 24, 0.14);
    transform: translateY(-1px);
  }
}

.product-image {
  display: grid;
  width: 112px;
  aspect-ratio: 1;
  align-self: center;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(135deg, rgba(184, 75, 58, 0.14), rgba(23, 111, 99, 0.17)),
    #fff;
  color: var(--brand-dark);
  font-size: 42px;
  font-weight: 900;
}

.product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  padding: 0 2px 0 0;
}

.product-content h2 {
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.2;
  color: #2c241c;
  overflow-wrap: anywhere;
}

.product-content p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.34;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-foot strong {
  flex: 1 1 auto;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: var(--soft-gold);
  color: var(--gold);
  font-size: 14px;
  padding: 5px 9px;
}

.add-button {
  min-width: 64px;
  min-height: 34px;
  border: 0;
  background: linear-gradient(135deg, #176f63, #39b54a);
  color: #fff;
  box-shadow: 0 8px 16px rgba(23, 111, 99, 0.18);
  padding: 0 12px;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(31, 41, 51, 0.46);
}

.cart-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 21;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  max-height: 92vh;
  border: 1px solid rgba(217, 200, 173, 0.72);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 236, 0.98));
  box-shadow: 0 -18px 46px rgba(42, 32, 22, 0.18);
  transform: translateY(104%);
  transition: transform 0.2s ease;
}

.cart-panel.open {
  transform: translateY(0);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(217, 200, 173, 0.72);
  background: linear-gradient(135deg, rgba(255, 244, 213, 0.7), rgba(233, 244, 239, 0.72));
  padding: 14px;
}

.cart-head h2 {
  margin: 0 0 4px;
  font-size: 21px;
}

.cart-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cart-list {
  min-height: 120px;
  overflow: auto;
  padding: 4px 14px;
}

.cart-item {
  border-bottom: 1px solid rgba(217, 200, 173, 0.82);
  padding: 8px 0;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-product {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.cart-thumb {
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: #fff8ec;
  box-shadow: inset 0 0 0 1px rgba(217, 200, 173, 0.58);
  color: var(--brand-dark);
  font-weight: 900;
}

.cart-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-copy {
  min-width: 0;
}

.cart-copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-copy span,
.empty-inline {
  color: var(--muted);
}

.merit-editor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.merit-editor input {
  width: 68px;
  min-height: 30px;
  border: 1px dashed rgba(183, 132, 43, 0.72);
  border-radius: 7px;
  background: #fff9e8;
  color: var(--brand-dark);
  padding: 4px 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.merit-editor input:focus {
  outline: 2px solid rgba(238, 178, 36, 0.38);
  outline-offset: 1px;
  border-style: solid;
}

.stepper {
  display: grid;
  grid-template-columns: 36px 36px 36px;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  border: 1px solid rgba(217, 200, 173, 0.78);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(76, 50, 24, 0.06);
}

.stepper button {
  width: 36px;
  height: 36px;
  border: 0;
  background: #fff4d5;
  color: #7a5012;
  font-size: 18px;
  font-weight: 900;
}

.stepper span {
  color: var(--ink);
  font-weight: 900;
}

.item-note {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  font-size: 12px;
}

.item-note span {
  color: var(--muted);
}

.item-note textarea {
  min-height: 36px;
  height: 36px;
  resize: none;
  border-color: rgba(217, 200, 173, 0.76);
  background: rgba(255, 255, 255, 0.88);
  padding: 8px 10px;
  line-height: 18px;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(217, 200, 173, 0.78);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
}

.cart-total span {
  color: var(--muted);
  font-weight: 800;
}

.cart-total strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.submit-button {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 88px;
  left: 16px;
  z-index: 40;
  width: fit-content;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  border-radius: 8px;
  background: rgba(31, 41, 51, 0.95);
  color: #fff;
  padding: 11px 14px;
  text-align: center;
  font-weight: 900;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 18px 12px 24px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 16px;
}

.result-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(31, 41, 51, 0.46);
  backdrop-filter: blur(4px);
}

.result-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(420px, 100%);
  max-height: 92vh;
  gap: 12px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(217, 200, 173, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 248, 236, 0.98));
  padding: 18px;
  box-shadow: 0 24px 60px rgba(42, 32, 22, 0.22);
}

.result-head {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -18px -18px 0;
  border-bottom: 1px solid rgba(217, 200, 173, 0.72);
  background: linear-gradient(135deg, rgba(255, 244, 213, 0.9), rgba(233, 244, 239, 0.92));
  padding: 14px 18px;
}

.result-panel h2 {
  margin: 0;
  font-size: 22px;
}

.icon-close {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1;
}

.result-panel p {
  margin: 0;
  color: var(--muted);
}

.result-panel img,
.receipt-link img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(76, 50, 24, 0.08);
}

.records-panel {
  width: min(560px, 100%);
}

.confirm-panel {
  width: min(390px, 100%);
}

.confirm-actions,
.response-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wallet-panel {
  width: min(560px, 100%);
}

.wallet-summary {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 8px;
}

.wallet-summary > div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(217, 200, 173, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.wallet-summary .wallet-main-balance {
  background: linear-gradient(135deg, #fff4d5, #fffaf0);
}

.wallet-summary span,
.wallet-history-head span,
.wallet-transaction span {
  color: var(--muted);
  font-size: 12px;
}

.wallet-summary strong {
  color: var(--brand-dark);
  font-size: 22px;
}

.wallet-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.wallet-history-head h3 {
  margin: 0;
  font-size: 16px;
}

.wallet-transactions {
  display: grid;
  max-height: min(52vh, 440px);
  gap: 8px;
  overflow: auto;
}

.wallet-transaction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(217, 200, 173, 0.62);
  padding: 9px 2px;
}

.wallet-transaction > div:first-child,
.wallet-transaction-amount {
  display: grid;
  gap: 3px;
}

.wallet-transaction-amount {
  flex: 0 0 auto;
  text-align: right;
}

.wallet-transaction-amount.income b {
  color: var(--green);
}

.wallet-transaction-amount.expense b {
  color: var(--brand-dark);
}

.response-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.response-card {
  display: grid;
  width: min(520px, 100%);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.response-card h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 34px);
}

.response-order-head,
.response-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.response-order-head > div {
  display: grid;
  gap: 4px;
}

.response-order-head span,
.response-warning {
  color: var(--muted);
  font-size: 13px;
}

.response-order-head b {
  color: var(--gold);
  white-space: nowrap;
}

.response-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.response-meta div {
  border-radius: 8px;
  background: var(--soft-gold);
  padding: 10px;
}

.response-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.response-meta dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.response-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.response-items li {
  border-bottom: 1px solid rgba(217, 200, 173, 0.64);
  padding: 7px 0;
}

.response-login,
.response-login label {
  display: grid;
  gap: 9px;
}

.response-login input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.response-message.error {
  border-radius: 8px;
  background: var(--soft-red);
  color: var(--brand-dark);
  padding: 10px 12px;
}

.response-result {
  border-radius: 8px;
  background: var(--soft-green);
  padding: 14px;
}

.response-result.rejected {
  background: var(--soft-red);
}

.response-result p {
  margin: 6px 0 0;
}

.response-home {
  display: grid;
  place-items: center;
}

.reject-button {
  border-color: rgba(184, 75, 58, 0.4);
  color: var(--brand-dark);
}

.response-actions .selected {
  box-shadow: 0 0 0 3px rgba(244, 166, 42, 0.26);
}

.records-list {
  display: grid;
  max-height: min(70vh, 620px);
  gap: 10px;
  overflow: auto;
}

.records-empty {
  padding: 18px 4px;
  text-align: center;
}

.receipt-record {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(217, 200, 173, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.receipt-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.receipt-record-head h3 {
  margin: 0 0 4px;
  color: #2c241c;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.receipt-record-head p,
.receipt-record-items {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.receipt-record-head strong {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 14px;
}

.receipt-record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.record-preview,
.record-delete {
  min-height: 36px;
  padding: 0 12px;
}

.record-delete {
  border-color: rgba(184, 75, 58, 0.24);
  color: var(--brand-dark);
}

.admin-topbar {
  align-items: center;
}

.status-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.status-tabs a {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 900;
}

.status-tabs a.active {
  border-color: var(--green);
  background: var(--soft-green);
  color: var(--green);
}

.order-list {
  display: grid;
  gap: 12px;
}

.admin-order {
  padding: 14px;
}

.admin-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-order-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.admin-order-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-new {
  background: var(--soft-green);
  color: var(--green);
}

.status-processing {
  background: #fff3d8;
  color: #80510c;
}

.status-done {
  background: #e8f5e9;
  color: #27632a;
}

.status-cancelled {
  background: #eef0f3;
  color: #555f6d;
}

.order-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 12px;
}

.order-meta div {
  min-width: 0;
  border-radius: 8px;
  background: #f6f2e9;
  padding: 9px;
}

.order-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-meta dd {
  margin: 4px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.order-lines {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.order-lines li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-lines strong,
.order-lines span {
  display: block;
}

.order-lines span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.order-lines b {
  flex: 0 0 auto;
  color: var(--gold);
}

.receipt-link {
  display: block;
  margin: 10px 0 12px;
}

.status-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.status-form select {
  max-width: 160px;
}

.empty-state {
  padding: 30px 16px;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 760px) {
  .shop-shell,
  .admin-shell {
    padding-top: 34px;
  }

  .cart-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(440px, 100vw);
    max-height: none;
    border-radius: 8px 0 0 8px;
    transform: translateX(104%);
  }

  .cart-panel.open {
    transform: translateX(0);
  }
}

@media (max-width: 680px) {
  .order-board {
    grid-template-columns: 1fr;
  }

  .catalog-search {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .catalog-search p {
    min-width: 0;
    text-align: left;
  }

  .categories {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    gap: 8px;
    padding: 7px;
  }

  .category {
    min-width: 0;
    padding: 0 6px;
    white-space: nowrap;
  }

  .topbar {
    align-items: center;
  }
}

@media (max-width: 520px) {
  .shop-shell,
  .admin-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .gate-panel {
    padding: 20px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .wallet-summary,
  .response-meta {
    grid-template-columns: 1fr;
  }

  .wallet-summary > div {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .wallet-summary > div span {
    grid-column: 1;
  }

  .wallet-summary > div strong {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .products {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: 92px 1fr;
    gap: 8px;
    min-height: 108px;
    padding: 8px;
  }

  .product-image {
    width: 92px;
  }

  .order-meta {
    grid-template-columns: 1fr;
  }

  .status-form {
    align-items: stretch;
    flex-direction: column;
  }

  .status-form select {
    max-width: none;
  }
}
