:root {
  color-scheme: light;
  --ink: #271450;
  --muted: #746889;
  --line: #eadfcf;
  --paper: #fffaf3;
  --green: #7b36b4;
  --green-dark: #2d135b;
  --gold: #ff6f5f;
  --purple: #7130aa;
  --purple-dark: #291155;
  --purple-soft: #b996dc;
  --coral: #f36b5d;
  --cream: #fff6e9;
  --gray-bone: #d1d8d5;
  --shadow: 0 24px 70px rgba(64, 36, 91, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='%237130aa' fill-opacity='.095'%3E%3Cellipse cx='42' cy='46' rx='8.5' ry='7.5'/%3E%3Cellipse cx='30' cy='35' rx='4.8' ry='6.2' transform='rotate(-22 30 35)'/%3E%3Cellipse cx='40' cy='28' rx='4.8' ry='6.5'/%3E%3Cellipse cx='50' cy='35' rx='4.8' ry='6.2' transform='rotate(22 50 35)'/%3E%3Cellipse cx='57' cy='45' rx='4.4' ry='5.7' transform='rotate(35 57 45)'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.88), transparent 58%),
    #fff3df;
  background-size: 88px 88px, auto, auto;
}

.brand-header {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: auto;
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 6px 11px 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.9);
  box-shadow: 0 14px 32px rgba(55, 27, 91, 0.1);
  backdrop-filter: blur(12px);
  transform: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.brand-header.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-70px);
}

.brand-header img {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
}

.brand-header span {
  color: var(--purple-dark);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
}

button,
input {
  font: inherit;
  font-size: 16px;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.shell {
  width: min(100% - 18px, 430px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 88px 0 22px;
}

.signup-screen,
.home-screen,
.wallet-screen,
.profile-screen,
.order-screen {
  display: none;
}

.signup-screen.is-active,
.home-screen.is-active,
.wallet-screen.is-active,
.profile-screen.is-active,
.order-screen.is-active {
  display: block;
}

.signup-card,
.shop-card,
.digital-wallet,
.loyalty-card,
.scan-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.signup-card {
  position: relative;
  padding: clamp(22px, 6vw, 38px);
}

.signup-screen.is-active {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(34, 16, 55, 0.34);
  backdrop-filter: blur(5px);
}

.signup-screen .signup-card {
  width: min(100%, 410px);
  border-radius: 28px;
}

.signup-copy {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.35;
}

.signup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(47, 20, 85, 0.08);
  color: var(--purple-dark);
  font-weight: 950;
}

.signup-card .secondary {
  margin-top: 10px;
}

.home-screen.is-active {
  display: grid;
  align-items: start;
  padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
}

.shop-card {
  overflow: hidden;
  border-radius: 28px;
  padding: clamp(12px, 2.2svh, 18px);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 221, 109, 0.24), transparent 32%),
    rgba(255, 255, 255, 0.92);
}

.shop-hero {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.shop-hero h1,
.shop-hero p,
.shop-hero span {
  margin: 0;
}

.shop-hero h1 {
  color: var(--purple-dark);
  font-size: clamp(1.18rem, 6vw, 1.65rem);
  font-weight: 950;
  line-height: 0.95;
}

.shop-hero span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 850;
  font-size: 0.82rem;
}

.shop-hero img {
  width: 72px;
  justify-self: end;
  filter: drop-shadow(0 14px 18px rgba(70, 23, 112, 0.12));
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 10px;
  padding-top: 14px;
}

.product-card {
  position: relative;
  min-height: 118px;
  display: grid;
  align-content: end;
  gap: 5px;
  padding: 42px 9px 10px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), #fff9ef);
  box-shadow: 0 14px 30px rgba(55, 27, 91, 0.08);
  text-align: left;
}

.product-card > img {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 56px;
  height: 68px;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 12px rgba(91, 37, 141, 0.14));
  pointer-events: none;
}

.product-card h2,
.product-card p,
.product-card strong {
  margin: 0;
}

.product-card h2 {
  color: var(--purple-dark);
  font-size: clamp(0.72rem, 3.4vw, 0.92rem);
  font-weight: 950;
  line-height: 1.05;
}

.product-card p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.product-card strong {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ff6573;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(255, 101, 115, 0.22);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 28px;
  font-size: clamp(2.1rem, 10vw, 4.4rem);
  line-height: 0.96;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

input:focus {
  border-color: var(--green);
  outline: 3px solid rgba(36, 112, 91, 0.14);
}

.primary {
  padding: 0 18px;
  background: var(--purple);
  color: white;
  font-weight: 900;
}

.primary:hover {
  background: var(--purple-dark);
}

.secondary {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.full {
  width: 100%;
}

.digital-wallet,
.loyalty-card {
  display: grid;
  justify-items: center;
  padding: clamp(20px, 6vw, 34px);
  text-align: center;
}

.wallet-screen.is-active {
  display: grid;
  gap: 14px;
  padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}

.loyalty-card {
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 22%, rgba(152, 105, 206, 0.08), transparent 34%),
    #ffffff;
  padding: 16px 22px;
}

.loyalty-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.loyalty-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 12px);
  width: 100%;
  margin: clamp(-18px, -2svh, -8px) auto clamp(8px, 1.2svh, 12px);
  text-align: center;
}

.loyalty-title h1 {
  margin: 0;
  color: var(--purple-dark);
  font-size: clamp(1.18rem, 6vw, 1.82rem);
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.loyalty-header h1 {
  margin: 0;
  color: var(--purple-dark);
  font-size: clamp(2rem, 10vw, 2.75rem);
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.header-bone {
  width: 78px;
  height: auto;
  flex: 0 0 auto;
}

.loyalty-path {
  position: relative;
  width: 260px;
  height: 604px;
  margin: 16px auto 2px;
}

.path-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 560px;
  overflow: visible;
}

.path-line path {
  fill: none;
  stroke: var(--purple-soft);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 12 14;
}

.path-nodes {
  position: absolute;
  inset: 0;
}

.path-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  transform: translate(-50%, 0);
  border: 3px solid var(--purple-soft);
  border-radius: 999px;
  background: #ffffff;
  color: var(--purple-soft);
  box-shadow: 0 10px 18px rgba(70, 23, 112, 0.08);
}

.path-node.is-earned {
  border-color: transparent;
  background: radial-gradient(circle at 35% 25%, #8b41c5, #5a248f);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(91, 37, 141, 0.22);
}

.path-node.is-current {
  outline: 4px solid rgba(241, 106, 89, 0.38);
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(241, 106, 89, 0.12), 0 16px 28px rgba(91, 37, 141, 0.28);
  z-index: 4;
}

.path-node.is-current::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(241, 106, 89, 0.55);
  border-radius: inherit;
  pointer-events: none;
}

.path-node span {
  position: absolute;
  top: 6px;
  font-size: 1.75rem;
  font-weight: 950;
  line-height: 1;
}

.path-node img {
  position: absolute;
  bottom: 9px;
  width: 34px;
  height: 30px;
  object-fit: contain;
}

.prize-bag {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 98px;
  transform: translateX(-50%);
}

.progress-copy {
  display: grid;
  justify-items: center;
  margin-top: clamp(22px, 4svh, 42px);
}

.purchase-count {
  margin: 0;
  color: var(--purple-dark);
  font-size: clamp(2.4rem, 13vw, 3.35rem);
  font-weight: 950;
  line-height: 1;
}

.purchase-count::first-letter {
  color: #8644c5;
}

.remaining-count {
  margin: 8px 0 0;
  color: var(--coral);
  font-size: clamp(1.85rem, 8vw, 2.35rem);
  font-weight: 950;
  line-height: 1;
}

.reward-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 26px 0 18px;
  padding: 12px 20px;
  border-radius: 18px;
  background: linear-gradient(90deg, #fff6e9, #ffffff, #fff1df);
  opacity: 1;
  filter: none;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.reward-card.is-ready {
  border: 2px solid #d8a629;
  background: linear-gradient(100deg, #fff8db, #ffffff, #ffe8a7);
  box-shadow: 0 14px 30px rgba(194, 139, 23, 0.22);
  opacity: 1;
  filter: none;
}

.reward-card.is-ready strong,
.reward-card.is-ready p {
  color: #9a6a08;
}

.reward-bone {
  width: 88px;
  height: auto;
}

.reward-card p,
.reward-card strong {
  display: block;
  margin: 0;
  text-align: left;
  line-height: 1.02;
}

.reward-card p {
  color: var(--purple-dark);
  font-size: 1.55rem;
  font-weight: 950;
}

.reward-card strong {
  color: var(--coral);
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 950;
}

.qr-button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 70px;
  padding: 0 42px;
  border-radius: 19px;
  background: linear-gradient(135deg, #8b41c5, #5a248f);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(91, 37, 141, 0.24);
}

.qr-button img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.qr-button span {
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 950;
  line-height: 1;
  text-align: left;
}

.scan-hint {
  margin: 14px 0 0;
  color: #746889;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 20;
  width: min(calc(100% - 28px), 390px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  padding: 6px 18px max(8px, env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(126, 62, 181, 0.1);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -10px 28px rgba(55, 27, 91, 0.1);
  backdrop-filter: blur(10px);
}

.bottom-nav button {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 50px;
  background: transparent;
  color: #6d6287;
  font-weight: 800;
}

.bottom-nav img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.bottom-nav span {
  font-size: 0.78rem;
}

.bottom-nav .is-active {
  position: relative;
  color: var(--purple);
}

.bottom-nav .is-active::after {
  content: "";
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--purple);
}

.profile-screen.is-active {
  display: grid;
  gap: clamp(8px, 1.5svh, 14px);
  padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}

.profile-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  padding: clamp(18px, 4.5vw, 26px);
}

.back-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #eadcf2;
  border-radius: 999px;
  background: #fbf5ff;
  color: var(--purple-dark);
  font-weight: 900;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 22px;
}

.profile-header img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.profile-header p,
.profile-header h1 {
  margin: 0;
  text-align: left;
}

.profile-header p {
  color: var(--coral);
  font-weight: 900;
}

.profile-header h1 {
  color: var(--purple-dark);
  font-size: clamp(2rem, 10vw, 3.2rem);
  line-height: 1;
}

.profile-form {
  display: grid;
}

.profile-form .primary {
  margin-top: 6px;
  background: linear-gradient(135deg, #8b41c5, #5a248f);
  min-height: 54px;
  border-radius: 14px;
}

.recovery-box {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(128, 73, 184, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(255, 255, 255, 0.96));
}

.recovery-box p,
.recovery-box span {
  margin: 0;
  text-align: left;
}

.recovery-box p {
  color: var(--purple-dark);
  font-weight: 950;
}

.recovery-box span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.25;
}

.recovery-box input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  color: var(--purple-dark);
  background: rgba(255, 255, 255, 0.84);
}

.recovery-box .secondary {
  min-height: 44px;
  border-color: rgba(128, 73, 184, 0.22);
  border-radius: 12px;
  color: var(--purple);
  font-weight: 900;
}

.profile-addresses {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid rgba(128, 73, 184, 0.16);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-addresses p,
.profile-addresses span {
  margin: 0;
}

.profile-addresses > div:first-child p {
  color: var(--purple-dark);
  font-size: 0.9rem;
  font-weight: 950;
}

.profile-addresses > div:first-child span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.profile-address-list {
  display: grid;
  gap: 8px;
}

.profile-address-row,
.profile-empty {
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
}

.profile-address-row {
  display: grid;
  gap: 4px;
}

.profile-address-row strong,
.profile-address-row span,
.profile-address-row small {
  display: block;
}

.profile-address-row strong {
  color: var(--purple-dark);
  font-size: 0.88rem;
  font-weight: 950;
}

.profile-address-row span,
.profile-address-row small,
.profile-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1.28;
}

.logout-button {
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid rgba(240, 68, 56, 0.2);
  border-radius: 14px;
  background: #fff5f4;
  color: #b42318;
  font-weight: 950;
}

.qr-image {
  display: grid;
  place-items: center;
  width: min(100%, 330px);
  aspect-ratio: 1;
  border: 10px solid white;
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 34px rgba(24, 32, 31, 0.14);
}

.qr-image svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dog-name {
  margin: 20px 0 4px;
  color: var(--green-dark);
  font-size: clamp(2.2rem, 11vw, 4.6rem);
  font-weight: 950;
  line-height: 0.96;
  overflow-wrap: anywhere;
}

.member-code {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 900;
}

.bone-meter {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
  gap: 10px;
}

.qr-modal {
  width: min(92vw, 420px);
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
  margin: auto;
}

.qr-modal::backdrop {
  background: rgba(31, 15, 61, 0.5);
  backdrop-filter: blur(4px);
}

.qr-modal-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 12px;
  padding: 24px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(31, 15, 61, 0.22);
}

.qr-modal .qr-image {
  margin: 0 auto;
}

.qr-modal .member-code,
.qr-modal .modal-title {
  width: 100%;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  border-radius: 999px;
  background: #f5edf8;
  color: var(--purple-dark);
  font-size: 1.4rem;
  font-weight: 900;
}

.modal-title {
  margin: 8px 0 0;
  color: var(--purple-dark);
  font-size: 1.35rem;
  font-weight: 900;
}

.bone {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid rgba(24, 32, 31, 0.08);
  border-radius: 8px;
  background: var(--gray-bone);
  color: #7d8885;
  font-weight: 950;
  font-size: clamp(1rem, 5vw, 1.8rem);
}

.bone.is-earned {
  border-color: #ffe4a0;
  background: #fff5d6;
  color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244, 200, 91, 0.18), 0 12px 24px rgba(198, 144, 36, 0.18);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scan-shell {
  width: min(100% - 28px, 520px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 22px 0;
}

.server-shell {
  width: min(100% - 28px, 760px);
  gap: 16px;
}

.scan-card {
  padding: 24px;
}

.scan-card.sales-card {
  position: relative;
  overflow: hidden;
}

.scan-card.sales-card::before {
  content: "H H H";
  position: absolute;
  top: 14px;
  right: 16px;
  color: rgba(198, 144, 36, 0.2);
  font-size: 1.3rem;
  font-weight: 950;
  pointer-events: none;
}

.scan-dog {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: clamp(2rem, 10vw, 4rem);
  font-weight: 950;
  line-height: 1;
}

.scan-meta {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 800;
}

.scan-result {
  margin: 14px 0 0;
  color: var(--green-dark);
  font-weight: 900;
}

.scanner-box {
  display: grid;
  gap: 10px;
  margin-bottom: 15px;
}

.camera-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(198, 144, 36, 0.26);
  border-radius: 8px;
  background: #fff8e6;
  color: #725213;
  font-size: 0.88rem;
  font-weight: 800;
}

#scannerVideo {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101615;
  object-fit: cover;
}

#scannerVideo.is-active {
  display: block;
}

.scanner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.server-list-card {
  align-self: start;
}

.server-list {
  display: grid;
  gap: 10px;
}

.server-member {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

.server-member::before {
  content: "H";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  float: left;
  margin-right: 10px;
  border-radius: 8px;
  background: #fff5d6;
  color: var(--gold);
  font-weight: 950;
}

.server-member strong {
  color: var(--green-dark);
  font-size: 1rem;
}

.server-member span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-shell {
  width: min(100% - 24px, 1040px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 22px 0 30px;
}

.admin-locked .admin-shell {
  display: none;
}

.admin-authenticated .admin-login {
  display: none;
}

.admin-login {
  width: min(100% - 24px, 430px);
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 24px 0;
}

.admin-login-card {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 6vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(55, 27, 91, 0.12);
}

.admin-login-card > img {
  width: 74px;
  justify-self: center;
}

.admin-login-card h1 {
  margin: 0 0 8px;
  color: var(--purple-dark);
  font-size: clamp(2.2rem, 12vw, 3.6rem);
  line-height: 0.95;
  text-align: center;
}

.admin-shell-simple {
  width: min(100% - 20px, 720px);
}

.admin-shell-simple.has-member .admin-scanner {
  display: none;
}

.admin-header-compact {
  margin-bottom: 12px;
}

.admin-header-compact h1 {
  font-size: clamp(2rem, 10vw, 3.6rem);
}

.admin-tabs {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 18px;
  background: rgba(255, 251, 244, 0.9);
  backdrop-filter: blur(10px);
}

.admin-tabs button {
  min-height: 42px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.admin-tabs button.is-active {
  background: linear-gradient(145deg, #8d3fd1, #4d1a87);
  color: #fff;
  box-shadow: 0 10px 20px rgba(90, 33, 145, 0.14);
}

.admin-view {
  display: none;
}

.admin-view.is-active {
  display: grid;
  gap: 16px;
}

.admin-shell-simple .admin-selected-card {
  display: none;
}

.admin-shell-simple .admin-selected-card:has(.admin-dog-badge) {
  display: grid;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 44px rgba(55, 27, 91, 0.09);
}

.admin-header h1 {
  margin: 0;
  color: var(--purple-dark);
  font-size: clamp(2rem, 7vw, 4.2rem);
  font-weight: 950;
  line-height: 0.95;
}

.admin-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.admin-meta-button {
  min-height: 36px;
  margin-top: 10px;
  padding: 0 13px;
  border: 1px solid rgba(126, 62, 181, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--purple-dark);
  font-size: 0.9rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(55, 27, 91, 0.08);
}

.admin-meta-button:active {
  transform: translateY(1px);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.admin-header-actions img {
  width: clamp(74px, 16vw, 140px);
  flex: 0 0 auto;
}

.admin-refresh-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(126, 62, 181, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 20px rgba(55, 27, 91, 0.1);
}

.admin-refresh-button svg {
  width: 20px;
  height: 20px;
  color: var(--purple);
  stroke-width: 3;
}

.admin-refresh-button:active {
  transform: translateY(1px);
}

.admin-refresh-button.is-loading svg {
  animation: refresh-spin 700ms linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.admin-card {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 38px rgba(55, 27, 91, 0.08);
}

.admin-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-card-title img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
}

.admin-card-title h2 {
  margin: 0;
  color: var(--purple-dark);
  font-size: 1.2rem;
  font-weight: 950;
}

.admin-card-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.admin-selected {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(126, 62, 181, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(252, 248, 239, 0.95), rgba(255, 255, 255, 0.88));
}

.admin-selected > p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.admin-dog-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-dog-badge img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.admin-dog-badge strong {
  display: block;
  color: var(--purple-dark);
  font-size: 1.5rem;
  font-weight: 950;
  line-height: 1;
}

.admin-dog-badge span,
.admin-contact {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-stats span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(126, 62, 181, 0.1);
  color: var(--purple-dark);
  font-weight: 900;
}

.admin-stats b {
  color: var(--coral);
}

.admin-contact {
  margin: 0;
}

.admin-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 8px;
}

.admin-step {
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid rgba(126, 62, 181, 0.28);
  border-radius: 999px;
  background: #fff;
  color: rgba(126, 62, 181, 0.45);
}

.admin-step.is-earned {
  border-color: transparent;
  background: linear-gradient(145deg, #8d3fd1, #4d1a87);
  color: #fff;
  box-shadow: 0 10px 20px rgba(90, 33, 145, 0.16);
}

.admin-step.is-gold {
  border-color: transparent;
  background: linear-gradient(145deg, #f8d35b, #b87b10);
  color: #fff8dc;
  box-shadow: 0 10px 22px rgba(184, 123, 16, 0.22);
}

.admin-step strong {
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  font-weight: 950;
  line-height: 1;
}

.admin-step img {
  width: 42%;
  max-width: 22px;
  filter: grayscale(1) opacity(0.55);
}

.admin-sale-box {
  display: grid;
  gap: 12px;
}

.sale-product-picker,
.sale-discount-box,
.sale-total-box {
  border: 1px solid rgba(112, 58, 159, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.sale-box-title,
.sale-total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sale-box-title {
  margin-bottom: 10px;
}

.sale-box-title strong,
.sale-total-box strong {
  color: var(--purple-dark);
  font-weight: 950;
}

.sale-box-title span,
.sale-total-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.sale-total-box strong {
  color: var(--coral);
  font-size: 1.25rem;
}

.sale-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sale-product-card {
  min-height: 92px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(112, 58, 159, 0.12);
  border-radius: 14px;
  background: #fffaf4;
  text-align: left;
  color: var(--purple-dark);
}

.sale-product-card img {
  grid-row: span 3;
  width: 42px;
  height: 54px;
  object-fit: contain;
}

.sale-product-card span {
  align-self: end;
  font-size: 0.72rem;
  line-height: 1.08;
  font-weight: 900;
}

.sale-product-card strong {
  align-self: start;
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 950;
}

.sale-product-card small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
}

.sale-product-card.is-selected {
  border-color: rgba(112, 58, 159, 0.58);
  background: #f4ecff;
  box-shadow: 0 10px 22px rgba(67, 33, 96, 0.12);
}

.sale-product-card.is-out-of-stock {
  opacity: 0.46;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

.sale-items-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.sale-item-row {
  display: grid;
  grid-template-columns: 1fr 64px auto 30px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(248, 243, 236, 0.78);
}

.sale-item-row strong,
.sale-item-row span {
  display: block;
}

.sale-item-row strong {
  color: var(--purple-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.sale-item-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.sale-item-row select {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(112, 58, 159, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: var(--purple-dark);
  font-weight: 900;
}

.sale-item-row b {
  color: var(--coral);
  font-size: 0.82rem;
  white-space: nowrap;
}

.sale-item-row button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 50%;
  background: rgba(240, 91, 82, 0.12);
  color: var(--coral);
  font-weight: 950;
}

.sale-discount-box summary {
  cursor: pointer;
  color: var(--purple-dark);
  font-weight: 950;
}

.sale-discount-box[open] summary {
  margin-bottom: 10px;
}

.coupon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.coupon-list button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f4ecff;
  color: var(--purple-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.admin-reward-ready {
  display: none;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 2px solid #d8a629;
  border-radius: 16px;
  background: linear-gradient(100deg, #fff6cf, #fffdf6, #ffe39b);
  color: #805605;
}

.admin-reward-ready.is-visible {
  display: grid;
}

.admin-reward-ready img {
  width: 54px;
}

.admin-reward-ready strong,
.admin-reward-ready span {
  display: block;
}

.admin-reward-ready strong {
  font-size: 1.05rem;
  font-weight: 950;
}

.admin-reward-ready span {
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-reward-ready button {
  grid-column: 1 / -1;
  min-height: 46px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f8d35b, #b87b10);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(184, 123, 16, 0.2);
}

.purchase-status {
  min-height: 44px;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(126, 62, 181, 0.18);
  border-radius: 14px;
  background: rgba(126, 62, 181, 0.08);
  color: var(--purple-dark);
  font-weight: 900;
  text-align: center;
}

.purchase-status:empty {
  display: none;
}

.admin-sale-box button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.server-member {
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.server-member:hover,
.server-member.is-selected {
  border-color: rgba(126, 62, 181, 0.4);
  box-shadow: 0 12px 24px rgba(55, 27, 91, 0.08);
  transform: translateY(-1px);
}

.server-member.is-selected {
  background: rgba(126, 62, 181, 0.08);
}

.admin-events {
  display: grid;
  gap: 9px;
}

.admin-sales-sections {
  display: grid;
  gap: 16px;
}

.admin-sales-group {
  display: grid;
  gap: 10px;
}

.admin-sales-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(126, 62, 181, 0.08);
}

.admin-sales-group h3,
.admin-sales-group p {
  margin: 0;
}

.admin-sales-group h3 {
  color: var(--purple-dark);
  font-size: 0.98rem;
  font-weight: 950;
}

.admin-sales-group p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.admin-sales-group > header > strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: #d83f35;
  font-size: 0.78rem;
  font-weight: 950;
}

.admin-sales-group > header > strong::before,
.shipment-alert {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f04438;
  box-shadow: 0 0 0 5px rgba(240, 68, 56, 0.13);
}

.admin-event {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-event::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-bottom: -22px;
  background: url("/assets/bone.png") center / contain no-repeat;
}

.admin-event strong,
.admin-event span,
.admin-event small {
  padding-left: 30px;
}

.admin-event strong {
  color: var(--purple-dark);
  font-weight: 950;
}

.admin-event span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
}

.admin-event small {
  color: rgba(40, 26, 57, 0.62);
  font-size: 0.76rem;
  font-weight: 760;
}

@media (max-width: 840px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-selected-card {
    order: -1;
  }
}

@media (max-width: 480px) {
  .shell,
  .scan-shell {
    width: min(100% - 20px, 620px);
  }

  .admin-shell {
    width: min(100% - 14px, 620px);
    padding-top: 10px;
  }

  .admin-header {
    align-items: flex-start;
    border-radius: 20px;
    padding: 18px;
  }

  .admin-header-actions img {
    width: 72px;
  }

  .admin-refresh-button {
    width: 38px;
    height: 38px;
  }

  .admin-card {
    border-radius: 18px;
  }

  .admin-card-title img {
    width: 40px;
    height: 40px;
  }

  .admin-progress {
    gap: 5px;
  }

  .admin-step {
    border-width: 1.5px;
  }

  .admin-dog-badge strong {
    font-size: 1.25rem;
  }

  .bone-meter {
    grid-template-columns: repeat(5, minmax(36px, 1fr));
    gap: 8px;
  }

  .loyalty-card {
    padding: 24px 20px 20px;
    border-radius: 30px;
  }

  .loyalty-path {
    transform: scale(0.92);
    transform-origin: top center;
    margin-bottom: -42px;
  }

  .reward-card {
    grid-template-columns: 72px 1fr;
    padding: 10px 14px;
  }

  .reward-bone {
    width: 70px;
  }

  .qr-button {
    min-height: 64px;
    padding: 0 24px;
  }

  .scanner-actions {
    grid-template-columns: 1fr;
  }
}

/* Responsive fit for the loyalty wallet */
.shell {
  width: min(100% - 16px, 430px);
  min-height: 100svh;
  padding: clamp(104px, 13svh, 128px) 0 calc(88px + env(safe-area-inset-bottom, 0px));
}

.wallet-screen.is-active {
  gap: clamp(4px, 1.2svh, 14px);
}

.loyalty-card {
  width: min(100%, 310px);
  padding: clamp(14px, 2.4svh, 22px) clamp(16px, 5vw, 24px);
  justify-self: center;
}

.loyalty-header {
  gap: clamp(8px, 2vw, 12px);
}

.loyalty-header h1 {
  font-size: clamp(1.18rem, 6vw, 1.82rem);
}

.header-bone {
  width: clamp(46px, 13vw, 64px);
}

.loyalty-path {
  width: min(100%, 318px);
  height: auto;
  aspect-ratio: 360 / 190;
  margin: clamp(22px, 3.6svh, 34px) auto clamp(10px, 1.8svh, 18px);
}

.path-line {
  height: 100%;
}

.path-node {
  width: clamp(30px, 10.4vw, 42px);
  height: clamp(30px, 10.4vw, 42px);
  border-width: 2px;
}

.path-node span {
  top: clamp(2px, 0.6vw, 4px);
  font-size: clamp(0.68rem, 3vw, 0.9rem);
}

.path-node img {
  bottom: clamp(4px, 1vw, 6px);
  width: clamp(15px, 4.8vw, 20px);
  height: clamp(13px, 4.2vw, 18px);
}

.path-node.is-current {
  outline-width: 3px;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(241, 106, 89, 0.1), 0 12px 22px rgba(91, 37, 141, 0.24);
}

.path-node.is-current::after {
  inset: -8px;
}

.prize-bag {
  left: auto;
  right: clamp(10px, 4vw, 24px);
  bottom: clamp(8px, 3vw, 18px);
  width: clamp(58px, 18vw, 82px);
  transform: none;
  z-index: 3;
}

.purchase-count {
  font-size: clamp(1rem, 4.8vw, 1.38rem);
}

.remaining-count {
  margin-top: clamp(2px, 0.5svh, 5px);
  font-size: clamp(0.78rem, 3.5vw, 1rem);
}

.reward-card {
  grid-template-columns: clamp(42px, 13vw, 62px) auto;
  gap: clamp(8px, 2.5vw, 14px);
  width: min(100%, 330px);
  margin: clamp(18px, 3svh, 34px) auto clamp(16px, 2.4svh, 24px);
  padding: clamp(8px, 1.5svh, 12px) clamp(12px, 4.8vw, 20px);
  justify-content: center;
}

.reward-bone {
  width: clamp(42px, 13vw, 62px);
  justify-self: center;
}

.reward-card p {
  font-size: clamp(1.1rem, 5.2vw, 1.55rem);
  text-align: left;
}

.reward-card strong {
  font-size: clamp(1rem, 4.9vw, 1.68rem);
  text-align: left;
}

.qr-button {
  width: min(100%, 330px);
  min-height: clamp(46px, 6.8svh, 58px);
  gap: clamp(8px, 3vw, 12px);
  padding: 0 clamp(18px, 7vw, 30px);
  justify-self: center;
  margin: clamp(10px, 1.5svh, 16px) auto 0;
  grid-template-columns: auto auto;
  justify-content: center;
}

.qr-button img {
  width: clamp(30px, 9vw, 42px);
  height: clamp(30px, 9vw, 42px);
}

.qr-button span {
  font-size: clamp(1.2rem, 5.9vw, 2rem);
  text-align: center;
}

.scan-hint {
  margin-top: clamp(6px, 1svh, 10px);
  font-size: clamp(0.82rem, 3.6vw, 1rem);
}

.bottom-nav {
  padding: 6px clamp(14px, 5vw, 18px) max(8px, env(safe-area-inset-bottom, 0px));
}

.bottom-nav button {
  min-height: clamp(44px, 6.4svh, 52px);
}

.bottom-nav img {
  width: clamp(22px, 6vw, 28px);
  height: clamp(22px, 6vw, 28px);
}

.bottom-nav span {
  font-size: clamp(0.7rem, 3vw, 0.82rem);
}

@media (max-width: 480px) {
  .shell,
  .scan-shell {
    width: min(100% - 14px, 620px);
  }

  .loyalty-card {
    width: min(100%, 292px);
    padding: clamp(10px, 1.8svh, 15px) clamp(14px, 5vw, 20px);
  }

  .loyalty-path {
    width: min(100%, 306px);
    transform: none;
    margin-top: clamp(24px, 4svh, 34px);
    margin-bottom: clamp(14px, 2.6svh, 22px);
  }
}

@media (max-height: 760px) {
  .loyalty-card {
    border-radius: 24px;
  }

  .loyalty-path {
    width: min(100%, 300px);
  }

  .loyalty-header h1 {
    font-size: clamp(1.05rem, 5.4vw, 1.38rem);
  }

  .header-bone {
    width: clamp(44px, 12vw, 58px);
  }
}

@media (max-height: 660px) {
  .loyalty-path {
    width: min(100%, 286px);
  }

  .reward-card {
    margin-top: 8px;
  }

  .scan-hint {
    display: none;
  }
}

/* Final loyalty layout overrides */
.home-screen.is-active {
  min-height: calc(100svh - 170px);
}

.shell:has(.home-screen.is-active) {
  padding-top: clamp(58px, 8svh, 76px);
}

.home-screen .shop-card {
  max-height: calc(100svh - 176px);
  overflow: hidden;
}

.wallet-screen .loyalty-card {
  width: min(100%, 342px);
  padding: clamp(14px, 2.4svh, 22px) clamp(16px, 5vw, 24px);
}

/* Clean shop layout */
.home-screen.is-active {
  display: grid;
  gap: clamp(12px, 2svh, 18px);
  min-height: auto;
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

.shell:has(.home-screen.is-active) {
  align-items: start;
  padding-top: clamp(14px, 2.4svh, 24px);
}

.shop-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.shop-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shop-brand img {
  width: clamp(44px, 12vw, 58px);
  height: clamp(44px, 12vw, 58px);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(70, 23, 112, 0.12);
}

.shop-brand strong {
  color: var(--purple-dark);
  font-size: clamp(1.7rem, 8vw, 2.55rem);
  font-weight: 950;
  line-height: 1;
}

.cart-button {
  position: relative;
  width: 48px;
  height: 48px;
  min-height: 48px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--purple-dark);
}

.cart-button::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 14px;
  width: 25px;
  height: 24px;
  border: 3px solid currentColor;
  border-radius: 4px 4px 9px 9px;
}

.cart-button::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.cart-button span {
  position: absolute;
  right: 0;
  top: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(242, 95, 87, 0.28);
}

.shop-hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 42%);
  align-items: center;
  gap: clamp(8px, 3vw, 18px);
  min-height: clamp(184px, 29svh, 250px);
  padding: clamp(20px, 6vw, 32px);
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 24%, rgba(128, 73, 184, 0.12) 0 10px, transparent 11px),
    radial-gradient(circle at 52% 82%, rgba(128, 73, 184, 0.1) 0 8px, transparent 9px),
    linear-gradient(135deg, #fffaf4, #fff4e7);
  box-shadow: 0 18px 42px rgba(70, 23, 112, 0.08);
}

.shop-hero-card::before,
.shop-hero-card::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 32px;
  border-radius: 50% 50% 45% 45%;
  background: rgba(128, 73, 184, 0.1);
  transform: rotate(-18deg);
}

.shop-hero-card::before {
  left: 42px;
  top: 54px;
}

.shop-hero-card::after {
  right: 32px;
  bottom: 52px;
}

.shop-hero-copy {
  position: relative;
  z-index: 1;
}

.shop-hero-copy p,
.shop-hero-copy h1 {
  margin: 0;
}

.shop-hero-copy p {
  color: var(--coral);
  font-size: clamp(0.78rem, 3vw, 1rem);
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shop-hero-copy h1 {
  margin-top: 12px;
  max-width: 12ch;
  color: var(--purple-dark);
  font-size: clamp(1.55rem, 7vw, 2.45rem);
  font-weight: 950;
  line-height: 1.05;
}

.shop-hero-copy a {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  margin-top: 22px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: clamp(0.92rem, 4vw, 1.05rem);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(242, 95, 87, 0.24);
}

.shop-hero-card > img {
  position: relative;
  z-index: 1;
  width: min(100%, 190px);
  max-height: 210px;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(70, 23, 112, 0.14));
}

.shop-search {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 18px;
  border: 1.5px solid rgba(70, 23, 112, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(70, 23, 112, 0.08);
}

.shop-search span {
  position: relative;
  width: 28px;
  height: 28px;
}

.shop-search span::before {
  content: "";
  position: absolute;
  inset: 1px 6px 7px 1px;
  border: 3px solid var(--purple-dark);
  border-radius: 50%;
}

.shop-search span::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: var(--purple-dark);
  transform: rotate(45deg);
}

.shop-search input {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--purple-dark);
  font-size: clamp(1rem, 4.5vw, 1.2rem);
  font-weight: 700;
  outline: none;
  box-shadow: none;
}

.shop-search input::placeholder {
  color: rgba(70, 23, 112, 0.5);
}

.shop-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 3vw, 14px);
}

.shop-filters button {
  min-height: 44px;
  padding: 0 10px;
  border: 1.5px solid rgba(128, 73, 184, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--purple);
  font-size: clamp(0.82rem, 3.8vw, 1rem);
  font-weight: 850;
}

.shop-filters button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #56268d, #8b3fbe);
  color: #fff;
  box-shadow: 0 12px 24px rgba(86, 38, 141, 0.2);
}

.shop-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.shop-section-title h2 {
  margin: 0;
  color: var(--purple-dark);
  font-size: clamp(1.45rem, 7vw, 2rem);
  font-weight: 950;
  line-height: 1;
}

.shop-section-title button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--coral);
  font-size: clamp(0.9rem, 4vw, 1rem);
  font-weight: 850;
}

.shop-section-title button::after {
  content: ">";
  margin-left: 9px;
  font-size: 1.25em;
}

.product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 4vw, 20px);
  padding: 0 0 8px;
}

.product-card {
  min-height: clamp(208px, 31svh, 250px);
  align-content: end;
  gap: 0;
  padding: clamp(12px, 3.6vw, 18px);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(70, 23, 112, 0.09);
}

.product-card > img {
  position: relative;
  top: auto;
  left: auto;
  width: min(100%, 128px);
  height: clamp(110px, 18svh, 138px);
  margin: 0 auto 10px;
  transform: none;
}

.product-card h2 {
  font-size: clamp(0.95rem, 4.2vw, 1.18rem);
  line-height: 1.08;
}

.product-card p {
  margin-top: 4px;
  color: #786f88;
  font-size: clamp(0.82rem, 3.8vw, 0.95rem);
}

.product-card strong {
  margin-top: 2px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--purple-dark);
  font-size: clamp(1.3rem, 6vw, 1.7rem);
  box-shadow: none;
}

.product-card button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 12px 20px rgba(242, 95, 87, 0.24);
}

@media (max-width: 380px) {
  .shop-hero-card {
    grid-template-columns: 1fr 100px;
    padding: 18px;
  }

  .shop-hero-copy a {
    min-height: 42px;
    margin-top: 16px;
    padding: 0 18px;
  }

  .product-card {
    min-height: 196px;
    padding: 12px;
  }

  .product-card > img {
    width: 106px;
    height: 104px;
  }

  .product-card button {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }
}

/* Catalog-only shop refresh */
.home-screen.is-active {
  gap: clamp(12px, 2svh, 18px);
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

.shop-topbar {
  min-height: clamp(72px, 10svh, 92px);
  padding: 12px clamp(14px, 4vw, 22px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 34px rgba(70, 23, 112, 0.1);
}

.shop-brand img {
  width: clamp(48px, 12vw, 64px);
  height: clamp(48px, 12vw, 64px);
}

.shop-brand strong {
  color: #0e1a35;
  font-size: clamp(1.65rem, 8vw, 2.6rem);
  text-shadow: 0 3px 0 rgba(70, 23, 112, 0.06);
}

.cart-button {
  display: none;
}

.shop-hero-card {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 40%);
  min-height: clamp(220px, 33svh, 290px);
  padding: clamp(22px, 6vw, 34px);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 75%, rgba(139, 65, 197, 0.18) 0 9px, transparent 10px),
    radial-gradient(circle at 56% 84%, rgba(139, 65, 197, 0.18) 0 9px, transparent 10px),
    radial-gradient(circle at 96% 82%, rgba(139, 65, 197, 0.18) 0 8px, transparent 9px),
    linear-gradient(100deg, #ffcdbb 0 47%, #fff5a8 47% 100%);
}

.shop-hero-card::before,
.shop-hero-card::after {
  display: none;
}

.shop-hero-copy p {
  color: #6f4bb2;
  font-size: clamp(1rem, 4.8vw, 1.35rem);
  font-weight: 950;
  text-transform: none;
}

.shop-hero-copy h1 {
  max-width: 9ch;
  margin-top: 14px;
  color: #0e1a35;
  font-size: clamp(2.25rem, 11vw, 4rem);
  line-height: 1.02;
  text-shadow: 0 4px 0 rgba(70, 23, 112, 0.05);
}

.shop-hero-copy a {
  min-height: clamp(48px, 7svh, 58px);
  margin-top: clamp(18px, 3svh, 26px);
  padding: 0 clamp(18px, 5vw, 30px);
  background: #f05249;
  font-size: clamp(1rem, 4.6vw, 1.25rem);
  box-shadow: 0 16px 26px rgba(240, 82, 73, 0.24);
}

.shop-hero-copy a::after {
  content: "";
  width: 22px;
  height: 22px;
  margin-left: 12px;
  background: url("assets/nav-paw.png") center / contain no-repeat;
  filter: brightness(0) invert(1);
}

.shop-hero-card > img {
  width: min(100%, 210px);
  max-height: 245px;
  align-self: end;
  transform: translateY(6px);
}

.shop-search {
  min-height: 62px;
  border-color: rgba(181, 139, 83, 0.28);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(70, 23, 112, 0.07);
}

.shop-search input {
  color: #0e1a35;
  font-weight: 750;
}

.shop-search input::placeholder {
  color: rgba(14, 26, 53, 0.55);
}

.shop-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 3vw, 16px);
}

.shop-filters button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: clamp(54px, 8svh, 70px);
  padding: 8px 10px;
  border-radius: 999px;
  color: #0e1a35;
  font-size: clamp(1rem, 4.8vw, 1.35rem);
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(70, 23, 112, 0.07);
}

.shop-filters button.is-active,
.shop-filters button {
  border-color: rgba(242, 95, 87, 0.2);
  background: #ffd5c5;
}

.shop-filters button.is-chicken {
  border-color: rgba(232, 182, 52, 0.26);
  background: #fff0b9;
}

.shop-filters button.is-mixed {
  border-color: rgba(128, 73, 184, 0.22);
  background: #f2e3fa;
}

.shop-filters img,
.filter-mix-icons img {
  width: clamp(34px, 9vw, 46px);
  height: clamp(34px, 9vw, 46px);
  object-fit: contain;
}

.filter-mix-icons {
  display: flex;
  align-items: center;
  gap: 0;
}

.filter-mix-icons img + img {
  margin-left: -8px;
}

.shop-section-title {
  justify-content: flex-start;
  margin-top: clamp(8px, 2svh, 18px);
}

.shop-section-title::before {
  content: "";
  width: 25px;
  height: 25px;
  background: url("assets/nav-paw.png") center / contain no-repeat;
  opacity: 0.28;
  transform: rotate(-18deg);
}

.shop-section-title h2 {
  color: #0e1a35;
  font-size: clamp(1.9rem, 9vw, 3rem);
  text-shadow: 0 4px 0 rgba(70, 23, 112, 0.05);
}

.shop-section-title button {
  display: none;
}

.product-grid {
  gap: clamp(14px, 4vw, 22px);
}

.product-card {
  min-height: clamp(258px, 38svh, 330px);
  padding: clamp(16px, 4vw, 22px);
  border: 1px solid rgba(181, 139, 83, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(70, 23, 112, 0.08);
}

.product-card > img {
  width: min(100%, 150px);
  height: clamp(142px, 23svh, 188px);
  margin: 0 auto 14px;
}

.product-card h2 {
  color: #0e1a35;
  font-size: clamp(1.05rem, 5vw, 1.45rem);
}

.product-card p {
  color: rgba(14, 26, 53, 0.62);
  font-size: clamp(0.95rem, 4.2vw, 1.12rem);
  font-weight: 750;
}

.product-card strong {
  color: #f05249;
  font-size: clamp(1.35rem, 6vw, 1.85rem);
}

.product-card button {
  display: none;
}

@media (max-width: 380px) {
  .shop-hero-card {
    min-height: 204px;
  }

  .shop-hero-card > img {
    max-height: 190px;
  }

  .product-card {
    min-height: 232px;
  }

  .product-card > img {
    height: 126px;
  }
}

/* Compact catalog filters and admin customer shortcut */
.shop-topbar {
  min-height: clamp(56px, 8svh, 76px);
  padding: 9px clamp(12px, 3.5vw, 18px);
  border-radius: clamp(18px, 5vw, 26px);
}

.shop-brand {
  gap: clamp(7px, 2.4vw, 10px);
}

.shop-brand img {
  width: clamp(38px, 10vw, 54px);
  height: clamp(38px, 10vw, 54px);
}

.shop-brand strong {
  max-width: calc(100vw - 112px);
  overflow: hidden;
  color: #0e1a35;
  font-size: clamp(1.35rem, 7vw, 2.15rem);
  font-weight: 1000;
  line-height: 0.95;
  white-space: nowrap;
}

.shop-filters {
  width: min(100%, 430px);
  margin-inline: auto;
  gap: clamp(6px, 2.3vw, 10px);
}

.shop-filters button {
  min-height: clamp(40px, 6svh, 50px);
  padding: 5px clamp(8px, 2.7vw, 12px);
  border-width: 1px;
  font-size: clamp(0.82rem, 3.6vw, 1rem);
  box-shadow: 0 7px 16px rgba(70, 23, 112, 0.06);
  opacity: 0.82;
  transform: translateY(0);
}

.shop-filters button.is-active {
  opacity: 1;
  box-shadow: 0 10px 20px rgba(70, 23, 112, 0.1);
}

.shop-filters img,
.filter-mix-icons img {
  width: clamp(24px, 6.8vw, 34px);
  height: clamp(24px, 6.8vw, 34px);
  animation: iconFloat 3.2s ease-in-out infinite;
}

.shop-filters button:nth-child(2) img {
  animation-delay: 0.45s;
}

.filter-mix-icons img:last-child {
  animation-delay: 0.8s;
}

.filter-mix-icons img + img {
  margin-left: -6px;
}

.product-card[hidden] {
  display: none;
}

.product-card.is-out-of-stock {
  opacity: 0.48;
  filter: grayscale(0.45);
}

.product-card.is-out-of-stock .checkout-button,
.product-card .checkout-button:disabled {
  background: #b8aebf;
  box-shadow: none;
  cursor: not-allowed;
}

.admin-client-link {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--purple);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(70, 23, 112, 0.08);
}

.admin-client-link:active {
  transform: translateY(1px);
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-5px) rotate(1deg);
  }
}

@media (max-width: 380px) {
  .shop-brand strong {
    font-size: clamp(1.2rem, 6.6vw, 1.72rem);
  }

  .shop-filters button {
    gap: 5px;
    padding-inline: 7px;
  }
}

/* Smaller shop brand */
.shop-topbar {
  min-height: clamp(46px, 6.8svh, 62px);
  padding: 7px clamp(10px, 3vw, 14px);
  border-radius: clamp(16px, 4vw, 22px);
}

.shop-brand img {
  width: clamp(30px, 8vw, 42px);
  height: clamp(30px, 8vw, 42px);
  box-shadow: 0 7px 14px rgba(70, 23, 112, 0.1);
}

.shop-brand strong {
  max-width: calc(100vw - 92px);
  font-size: clamp(1.05rem, 5.5vw, 1.58rem);
  font-weight: 950;
}

/* Extra compact store header */
.home-screen .shop-topbar {
  min-height: 48px;
  padding: 6px 12px;
  border-radius: 18px;
}

.home-screen .shop-brand {
  gap: 8px;
}

.home-screen .shop-brand img {
  width: clamp(28px, 7vw, 36px);
  height: clamp(28px, 7vw, 36px);
}

.home-screen .shop-brand strong {
  max-width: 160px;
  font-size: clamp(0.95rem, 4.2vw, 1.18rem);
  font-weight: 950;
  line-height: 1;
}

/* Compact horizontal store hero */
.home-screen .shop-hero-card {
  grid-template-columns: minmax(0, 1fr) minmax(118px, 42%);
  min-height: clamp(176px, 24svh, 220px);
  padding: clamp(16px, 4vw, 24px);
  align-items: center;
  border-radius: 24px;
}

.home-screen .shop-hero-copy p {
  font-size: clamp(0.82rem, 3.4vw, 1rem);
  line-height: 1.05;
}

.home-screen .shop-hero-copy h1 {
  max-width: 10ch;
  margin-top: 8px;
  font-size: clamp(1.7rem, 7vw, 2.35rem);
  line-height: 1.03;
}

.home-screen .shop-hero-copy a {
  min-height: clamp(38px, 5.8svh, 46px);
  margin-top: clamp(12px, 2.2svh, 18px);
  padding: 0 clamp(14px, 4vw, 20px);
  font-size: clamp(0.82rem, 3.8vw, 1rem);
}

.home-screen .shop-hero-copy a::after {
  width: 18px;
  height: 18px;
  margin-left: 8px;
}

.home-screen .shop-hero-card > img {
  width: min(100%, 172px);
  max-height: 196px;
  align-self: center;
  transform: translateY(2px);
}

@media (max-width: 380px) {
  .home-screen .shop-hero-card {
    grid-template-columns: minmax(0, 1fr) 118px;
    min-height: 166px;
    padding: 14px;
  }

  .home-screen .shop-hero-copy h1 {
    font-size: clamp(1.45rem, 7.2vw, 1.9rem);
  }

  .home-screen .shop-hero-card > img {
    max-height: 160px;
  }
}

/* Tight wallet/profile screens */
.shell:has(.wallet-screen.is-active),
.shell:has(.profile-screen.is-active) {
  align-items: start;
  min-height: auto;
  padding-top: clamp(10px, 2.4svh, 22px);
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.wallet-screen.is-active {
  gap: clamp(6px, 1.4svh, 12px);
  padding-bottom: 0;
}

.profile-screen.is-active {
  gap: 10px;
  padding-bottom: 0;
}

.profile-card {
  padding-top: clamp(14px, 3.2vw, 20px);
}

.profile-header {
  margin: 0 0 16px;
}

.back-button {
  display: none;
}

.wallet-screen .loyalty-card {
  margin-bottom: 0;
}

.wallet-screen .qr-button {
  margin-top: clamp(8px, 1.6svh, 14px);
}

/* Smaller catalog typography */
.home-screen .shop-search {
  min-height: clamp(46px, 6.4svh, 54px);
  border-radius: 22px;
  padding-inline: 14px;
}

.home-screen .shop-search span {
  width: 23px;
  height: 23px;
}

.home-screen .shop-search input {
  min-height: 34px;
  font-size: clamp(0.88rem, 3.8vw, 1rem);
  font-weight: 750;
}

.home-screen .shop-filters {
  width: min(100%, 360px);
  gap: 7px;
}

.home-screen .shop-filters button {
  min-height: clamp(34px, 5.2svh, 42px);
  gap: 5px;
  padding: 4px 8px;
  font-size: clamp(0.72rem, 3.2vw, 0.88rem);
  font-weight: 900;
}

.home-screen .shop-filters img,
.home-screen .filter-mix-icons img {
  width: clamp(20px, 5.6vw, 28px);
  height: clamp(20px, 5.6vw, 28px);
}

.home-screen .shop-section-title {
  margin-top: 2px;
  gap: 7px;
}

.home-screen .shop-section-title::before {
  width: 18px;
  height: 18px;
}

.home-screen .shop-section-title h2 {
  font-size: clamp(1.35rem, 6vw, 2rem);
  font-weight: 950;
}

.home-screen .product-card h2 {
  font-size: clamp(0.82rem, 3.6vw, 1.02rem);
  font-weight: 950;
  line-height: 1.08;
}

.home-screen .product-card p {
  font-size: clamp(0.78rem, 3.3vw, 0.92rem);
  font-weight: 800;
}

.home-screen .product-card strong {
  font-size: clamp(1.05rem, 4.8vw, 1.35rem);
  font-weight: 1000;
  letter-spacing: 0;
}

/* Loyalty title spacing */
.shell:has(.wallet-screen.is-active) {
  padding-top: clamp(46px, 7.5svh, 64px);
}

.wallet-screen .loyalty-title {
  justify-content: flex-start;
  width: min(100%, 342px);
  margin: 0 auto clamp(6px, 1svh, 10px);
  text-align: left;
}

.wallet-screen .loyalty-title .header-bone {
  width: clamp(30px, 8vw, 40px);
  flex: 0 0 auto;
}

.wallet-screen .loyalty-title h1 {
  font-size: clamp(0.95rem, 4.5vw, 1.24rem);
  font-weight: 950;
}

/* Admin member purchase list */
.server-member em {
  color: var(--coral);
  font-style: normal;
  font-size: 0.84rem;
  font-weight: 950;
}

.member-purchases {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}

.member-purchases small {
  color: #776985;
  font-size: 0.78rem;
  font-weight: 760;
}

.member-search {
  display: grid;
  gap: 7px;
  color: var(--purple-dark);
  font-size: 0.88rem;
  font-weight: 900;
}

.member-search input {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(126, 62, 181, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--purple-dark);
  font-size: 0.98rem;
  font-weight: 800;
}

.admin-form-grid {
  display: grid;
  gap: 11px;
}

.admin-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--purple-dark);
  font-size: 0.88rem;
  font-weight: 900;
}

.admin-form-grid input,
.admin-form-grid select {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(126, 62, 181, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--purple-dark);
  font-weight: 800;
}

.unit-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid rgba(126, 62, 181, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.unit-toggle::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  border-radius: 11px;
  background: linear-gradient(135deg, #703a9f, #8b45c7);
  box-shadow: 0 8px 16px rgba(67, 33, 96, 0.16);
  transition: transform 180ms ease;
}

.unit-toggle:has(input:checked)::before {
  transform: translateX(100%);
}

.unit-toggle input {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  cursor: pointer;
}

.unit-toggle b,
.unit-toggle i {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 46px;
  color: var(--purple-dark);
  font-style: normal;
  font-weight: 950;
}

.unit-toggle b {
  color: #fff;
}

.unit-toggle:has(input:checked) b {
  color: var(--purple-dark);
}

.unit-toggle:has(input:checked) i {
  color: #fff;
}

.admin-products,
.admin-expenses {
  display: grid;
  gap: 10px;
}

.catalog-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.catalog-subtabs button {
  min-height: 38px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.catalog-subtabs button.is-active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 10px 20px rgba(126, 62, 181, 0.2);
}

.catalog-panel {
  display: none;
}

.catalog-panel.is-active {
  display: grid;
  gap: 12px;
}

.admin-product-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.74);
}

.admin-product-row img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.admin-product-row strong,
.admin-expense-row strong {
  display: block;
  color: var(--purple-dark);
  font-weight: 950;
}

.admin-product-row span,
.admin-expense-row span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 780;
}

.admin-product-row button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(242, 95, 87, 0.12);
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 950;
}

.stock-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 244, 0.72);
}

.stock-list {
  display: grid;
  gap: 8px;
}

.stock-row {
  display: grid;
  grid-template-columns: 46px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.stock-row.is-empty {
  border-color: rgba(242, 95, 87, 0.25);
  background: rgba(242, 95, 87, 0.06);
}

.stock-row img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.stock-row strong {
  display: block;
  color: var(--purple-dark);
  font-size: 0.84rem;
  font-weight: 950;
}

.stock-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.stock-count {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(126, 62, 181, 0.1);
  color: var(--purple-dark);
  font-size: 0.84rem;
  font-weight: 950;
}

.stock-actions {
  display: flex;
  gap: 6px;
}

.stock-actions button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(126, 62, 181, 0.18);
}

.stock-actions button:first-child {
  background: rgba(126, 62, 181, 0.12);
  color: var(--purple-dark);
  box-shadow: none;
}

.profit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profit-summary span,
.admin-expense-row {
  padding: 10px 12px;
  border: 1px solid rgba(126, 62, 181, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.profit-summary b {
  display: block;
  color: var(--purple-dark);
  font-size: 1rem;
  font-weight: 950;
}

.profit-summary .is-profit b {
  color: #167a51;
}

.profit-summary .is-loss b {
  color: var(--coral);
}

.home-screen .product-card .checkout-button {
  position: static;
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  min-height: 36px;
  margin-top: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #f05249;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(240, 82, 73, 0.18);
}

.home-screen .product-card .checkout-button:active {
  transform: translateY(1px);
}

@media (max-width: 520px) {
  .admin-tabs {
    gap: 5px;
  }

  .admin-tabs button {
    min-height: 38px;
    border-radius: 10px;
    font-size: 0.72rem;
  }

  .profit-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .profit-summary {
    grid-template-columns: 1fr;
  }
}

.admin-event.is-redemption {
  border-color: rgba(216, 166, 41, 0.45);
  background: linear-gradient(135deg, #fff8db, #ffffff, #ffe8a7);
  box-shadow: 0 12px 24px rgba(194, 139, 23, 0.14);
}

.admin-event.is-redemption strong,
.admin-event.is-redemption span {
  color: #9a6a08;
}

.admin-event.is-web-order {
  border-color: rgba(36, 123, 91, 0.22);
  background: linear-gradient(135deg, #effdf5, #ffffff);
}

.admin-event.is-web-order strong {
  color: #176444;
}

.admin-event.is-pending-shipment {
  border-color: rgba(240, 68, 56, 0.34);
  background: linear-gradient(135deg, #fff1f0, #ffffff);
  box-shadow: 0 12px 28px rgba(240, 68, 56, 0.1);
}

.admin-event.is-pending-shipment strong {
  color: #b42318;
}

.sale-reject-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(240, 68, 56, 0.12);
  color: #b42318;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.sale-reject-button:active {
  transform: translateY(1px);
}

.shipment-alert {
  margin-right: 8px;
  vertical-align: 1px;
}

.order-status-select {
  width: calc(100% - 30px);
  margin: 8px 0 0 30px;
  border: 1px solid rgba(36, 123, 91, 0.18);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
  color: #176444;
  font-size: 0.78rem;
  font-weight: 900;
  outline: none;
}

/* Web checkout */
.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 8px 10px 8px 14px;
  background: #2f1455;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(47, 20, 85, 0.16);
}

.cart-button b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #f45d52;
  color: #fff;
  font-size: 12px;
}

.cart-modal {
  width: min(94vw, 520px);
  max-height: 92dvh;
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
}

.cart-modal::backdrop {
  background: rgba(34, 16, 55, 0.42);
  backdrop-filter: blur(4px);
}

.cart-panel {
  position: relative;
  max-height: 92dvh;
  overflow: auto;
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(180deg, #fff 0%, #fffaf3 100%);
  box-shadow: 0 30px 80px rgba(47, 20, 85, 0.28);
}

.cart-panel header p {
  margin: 0;
  color: #f45d52;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cart-panel header h2 {
  margin: 2px 0 16px;
  color: #2f1455;
  font-size: 30px;
  font-weight: 950;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-empty {
  margin: 0;
  border-radius: 18px;
  padding: 18px;
  background: rgba(47, 20, 85, 0.06);
  color: #766987;
  font-weight: 800;
  text-align: center;
}

.cart-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(47, 20, 85, 0.08);
  border-radius: 18px;
  padding: 10px;
  background: #fff;
}

.cart-row img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.cart-row strong,
.cart-row span {
  display: block;
}

.cart-row strong {
  color: #101d36;
  font-size: 14px;
  font-weight: 900;
}

.cart-row span {
  color: #766987;
  font-size: 12px;
  font-weight: 800;
}

.cart-qty {
  display: inline-grid;
  grid-template-columns: 28px 24px 28px;
  align-items: center;
  justify-items: center;
  gap: 2px;
}

.cart-qty button,
.cart-remove {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  background: #f4edf8;
  color: #6f34ad;
}

.cart-qty b {
  color: #2f1455;
  font-size: 13px;
}

.cart-remove {
  grid-column: 2 / -1;
  justify-self: start;
  padding: 5px 10px;
  background: transparent;
  color: #f45d52;
  font-size: 12px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0;
  border-radius: 18px;
  padding: 14px 16px;
  background: #2f1455;
  color: #fff;
}

.cart-total span {
  font-size: 13px;
  font-weight: 800;
}

.cart-total strong {
  font-size: 24px;
  font-weight: 950;
}

.saved-addresses {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #635a6f;
  font-size: 12px;
  font-weight: 900;
}

.saved-addresses[hidden] {
  display: none;
}

.saved-addresses select {
  width: 100%;
  border: 1px solid rgba(47, 20, 85, 0.14);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  color: #101d36;
  font-size: 14px;
  font-weight: 850;
  outline: none;
}

.saved-address-summary {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  border: 1px solid rgba(47, 20, 85, 0.1);
  border-radius: 16px;
  padding: 13px 14px;
  background: #fff;
}

.saved-address-summary[hidden],
.checkout-fields[hidden] {
  display: none;
}

.saved-address-summary strong,
.saved-address-summary span,
.saved-address-summary small {
  display: block;
}

.saved-address-summary strong {
  color: #2f1455;
  font-size: 14px;
  font-weight: 950;
}

.saved-address-summary span,
.saved-address-summary small {
  color: #766987;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.28;
}

.checkout-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkout-fields label {
  display: grid;
  gap: 6px;
  color: #635a6f;
  font-size: 12px;
  font-weight: 900;
}

.checkout-fields input {
  width: 100%;
  border: 1px solid rgba(47, 20, 85, 0.14);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  color: #101d36;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.checkout-fields input:focus {
  border-color: rgba(111, 52, 173, 0.55);
  box-shadow: 0 0 0 4px rgba(111, 52, 173, 0.1);
}

.checkout-fields label:nth-child(1),
.checkout-fields label:nth-child(4),
.checkout-notes {
  grid-column: 1 / -1;
}

.cart-panel > .primary {
  margin-top: 10px;
}

.cart-panel > .secondary {
  margin-top: 14px;
}

@media (max-width: 520px) {
  .cart-panel {
    padding: 20px;
  }

  .checkout-fields {
    grid-template-columns: 1fr;
  }

  .checkout-fields label {
    grid-column: 1 / -1;
  }

  .cart-row {
    grid-template-columns: 52px 1fr;
  }

  .cart-qty {
    grid-column: 2;
    justify-self: start;
  }

  .cart-remove {
    grid-column: 2;
  }
}

/* Paid order and tracking */
.order-screen.is-active {
  min-height: 100dvh;
  padding: 8px 16px 84px;
}

.order-card {
  width: min(100%, 720px);
  margin: 0 auto;
  border: 1px solid rgba(47, 20, 85, 0.08);
  border-radius: 30px;
  padding: 22px;
  background: linear-gradient(180deg, #fff 0%, #fffaf3 100%);
  box-shadow: 0 24px 70px rgba(47, 20, 85, 0.14);
}

.order-success {
  text-align: center;
}

.order-success img {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  object-fit: contain;
}

.order-success p {
  margin: 0;
  color: #1a7a53;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.order-success h1 {
  margin: 4px 0 6px;
  color: #2f1455;
  font-size: clamp(1.8rem, 8vw, 3rem);
  font-weight: 950;
  line-height: 0.95;
}

.order-success span {
  color: #766987;
  font-size: 13px;
  font-weight: 850;
}

.tracking-box {
  margin: 20px 0;
  border-radius: 24px;
  padding: 16px;
  background: #2f1455;
  color: #fff;
}

.tracking-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tracking-code span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.tracking-code strong {
  font-size: 18px;
  font-weight: 950;
}

.tracking-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  counter-reset: track;
}

.tracking-progress span {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.tracking-progress span::before {
  counter-increment: track;
  content: counter(track);
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 950;
}

.tracking-progress span.is-done {
  color: #fff;
}

.tracking-progress span.is-done::before {
  background: #f4c84e;
  color: #2f1455;
}

.tracking-progress span.is-current::before {
  box-shadow: 0 0 0 5px rgba(244, 200, 78, 0.18);
}

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

.order-box {
  border: 1px solid rgba(47, 20, 85, 0.08);
  border-radius: 22px;
  padding: 16px;
  background: #fff;
}

.order-box h2 {
  margin: 0 0 10px;
  color: #2f1455;
  font-size: 18px;
  font-weight: 950;
}

.order-box p {
  margin: 0 0 7px;
  color: #766987;
  font-size: 13px;
  font-weight: 780;
}

.order-box p strong {
  color: #101d36;
  font-size: 15px;
  font-weight: 950;
}

.order-item-row,
.order-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-item-row {
  border-bottom: 1px solid rgba(47, 20, 85, 0.08);
  padding: 9px 0;
}

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

.order-item-row strong {
  color: #101d36;
  font-size: 13px;
  font-weight: 950;
}

.order-item-row span {
  color: #766987;
  font-size: 12px;
  font-weight: 800;
}

.order-item-row b {
  color: #f45d52;
  font-size: 14px;
  font-weight: 950;
}

.order-total-line {
  margin-top: 12px;
  border-radius: 16px;
  padding: 12px;
  background: #fff4ec;
}

.order-total-line span {
  color: #766987;
  font-size: 12px;
  font-weight: 900;
}

.order-total-line strong {
  color: #2f1455;
  font-size: 20px;
  font-weight: 950;
}

.order-card > .secondary {
  margin-top: 14px;
}

@media (max-width: 640px) {
  .order-card {
    padding: 18px;
  }

  .tracking-progress {
    gap: 6px;
  }

  .tracking-progress span {
    font-size: 10px;
  }

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

/* Compact cart icon override */
.home-screen .cart-button {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: transparent;
  color: var(--purple-dark);
  box-shadow: none;
}

.home-screen .cart-button::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 15px;
  width: 25px;
  height: 22px;
  border: 3px solid currentColor;
  border-radius: 4px 4px 9px 9px;
}

.home-screen .cart-button::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.home-screen .cart-button b {
  position: absolute;
  top: 2px;
  right: 0;
  z-index: 2;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #f45d52;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

/* Center checkout dialog */
.cart-modal,
.cart-modal[open] {
  margin: auto;
  inset: 0;
}

/* Loyalty guest state */
.loyalty-guest {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 20px;
  border: 1px solid rgba(128, 73, 184, 0.16);
  border-radius: 28px;
  padding: 26px 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.loyalty-guest[hidden],
.loyalty-member[hidden] {
  display: none;
}

.loyalty-guest img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.loyalty-guest h1,
.loyalty-guest p {
  margin: 0;
}

.loyalty-guest h1 {
  color: var(--purple-dark);
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  font-weight: 950;
  line-height: 0.98;
}

.loyalty-guest p {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 780;
  line-height: 1.35;
}

.loyalty-guest .secondary {
  margin-top: -2px;
}

.account-recovery {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  border-top: 1px solid rgba(128, 73, 184, 0.12);
  padding-top: 14px;
  text-align: left;
}

.account-recovery label {
  display: grid;
  gap: 6px;
  color: var(--purple-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.account-recovery input {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
}

.account-recovery p {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
  text-align: center;
}
