:root {
  color-scheme: light;
  --app-font: Inter, "Inter var", "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  --ink: #18201f;
  --muted: #68706f;
  --line: #d9dedb;
  --paper: #fbfcfb;
  --panel: #ffffff;
  --soft: #f6edf8;
  --accent: #b81ed7;
  --accent-strong: #8611a3;
  --accent-rgb: 184 30 215;
  --coral: #b84a3b;
  --amber: #94651f;
  --success: #1f8a5b;
  --violet: #6d2b86;
  --radius: 8px;
  --shadow: 0 16px 40px rgba(30, 42, 38, 0.11);
  --shadow-strong: 0 22px 60px rgba(30, 42, 38, 0.16);
  --shine: rgba(255, 255, 255, 0.42);
  --keyboard-offset: 0px;
  --keyboard-safe-bottom: max(var(--keyboard-offset), env(safe-area-inset-bottom));
}

/* Prepare orders game: shop counter scene */
.prepare-stage {
  isolation: isolate;
  grid-template-rows: auto minmax(10.8rem, 1.1fr) auto auto;
  gap: 0.65rem;
  padding: 0.68rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.18);
  border-radius: calc(var(--radius) * 0.95);
  background:
    linear-gradient(180deg, rgba(226, 239, 236, 0.94) 0 28%, rgba(249, 240, 229, 0.95) 28% 57%, rgba(74, 59, 49, 0.94) 57% 65%, rgba(34, 38, 42, 0.96) 65% 100%),
    #f7efe8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
  touch-action: manipulation;
}

.prepare-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 1rem;
  right: 1rem;
  top: 3.2rem;
  height: 5.8rem;
  border-radius: calc(var(--radius) * 0.8);
  background:
    linear-gradient(90deg, rgba(71, 85, 105, 0.26) 0 1px, transparent 1px 18%),
    linear-gradient(180deg, transparent 0 32%, rgba(100, 116, 139, 0.28) 33% 35%, transparent 36% 68%, rgba(100, 116, 139, 0.22) 69% 71%, transparent 72%),
    rgba(255, 255, 255, 0.38);
}

.prepare-tutorial-card {
  border-color: rgba(124, 45, 53, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(244, 230, 222, 0.9)),
    #fff;
  box-shadow: 0 0.55rem 1.2rem rgba(24, 30, 35, 0.08);
}

.prepare-customers {
  position: relative;
  align-items: end;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 10.8rem;
  overflow: visible;
  padding: 0.15rem 0.32rem 0;
  touch-action: manipulation;
}

.prepare-customers::after {
  content: "";
  position: absolute;
  left: -0.35rem;
  right: -0.35rem;
  bottom: 0;
  height: 2.45rem;
  border-radius: 0.7rem 0.7rem 0.95rem 0.95rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, #36251f, #6f4634 50%, #34241f);
  box-shadow: 0 -0.22rem 0 rgba(255, 255, 255, 0.22), 0 0.9rem 1.8rem rgba(17, 24, 39, 0.18);
  pointer-events: none;
}

.prepare-customer,
.prepare-customer.is-urgent {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(5.2rem, 1fr);
  justify-items: center;
  gap: 0.25rem;
  min-height: 10.2rem;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  animation: none;
}

.prepare-customer:hover .prepare-order-bubble,
.prepare-customer:focus-visible .prepare-order-bubble {
  transform: translateY(-0.08rem);
}

.prepare-order-bubble {
  position: relative;
  z-index: 3;
  width: min(100%, 10.5rem);
  min-height: 4.5rem;
  padding: 0.48rem 0.5rem 0.5rem;
  border: 1px solid rgba(124, 45, 53, 0.2);
  border-radius: 0.82rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0.65rem 1.2rem rgba(17, 24, 39, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.prepare-order-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.38rem;
  width: 0.7rem;
  height: 0.7rem;
  background: inherit;
  border-right: 1px solid rgba(124, 45, 53, 0.2);
  border-bottom: 1px solid rgba(124, 45, 53, 0.2);
  transform: translateX(-50%) rotate(45deg);
}

.prepare-customer.is-urgent .prepare-order-bubble {
  border-color: rgba(217, 55, 55, 0.55);
  box-shadow: 0 0.7rem 1.35rem rgba(217, 55, 55, 0.18);
  animation: prepareUrgentPulse 840ms ease-in-out infinite alternate;
}

.prepare-bubble-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.prepare-bubble-top strong {
  min-width: 0;
  color: #6f2430;
  font-size: 0.78rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prepare-bubble-top small {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.25rem 0.38rem;
}

.prepare-customer.is-urgent .prepare-bubble-top small {
  background: #d93737;
}

.prepare-order-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.1rem, 1fr));
  gap: 0.22rem;
  margin-top: 0.28rem;
}

.prepare-order-item {
  display: grid;
  justify-items: center;
  gap: 0.08rem;
  min-width: 0;
}

.prepare-order-item .prepare-product-visual {
  width: 1.75rem;
  height: 1.55rem;
  transform: scale(0.82);
  transform-origin: center;
}

.prepare-order-item strong {
  max-width: 100%;
  color: var(--text);
  font-size: 0.56rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prepare-order-bubble em {
  margin-top: 0.32rem;
  height: 0.36rem;
  background: rgba(17, 24, 39, 0.1);
}

.prepare-order-bubble i {
  background: linear-gradient(90deg, #23b96f, #f538a9);
}

.prepare-customer-person {
  position: relative;
  z-index: 2;
  display: block;
  width: 4.85rem;
  height: 6.05rem;
  margin-top: 0.05rem;
  filter: drop-shadow(0 0.55rem 0.5rem rgba(15, 23, 42, 0.18));
}

.prepare-customer-head {
  position: absolute;
  left: 50%;
  top: 0.18rem;
  width: 2.25rem;
  height: 2.48rem;
  border-radius: 48% 48% 44% 44%;
  background: var(--skin);
  transform: translateX(-50%);
  box-shadow: inset 0 -0.25rem 0 rgba(106, 53, 31, 0.08);
}

.prepare-customer-hair {
  position: absolute;
  left: 0.08rem;
  right: 0.08rem;
  top: -0.12rem;
  height: 0.9rem;
  border-radius: 999px 999px 0.55rem 0.55rem;
  background: var(--hair);
}

.prepare-customer-hair::after {
  content: "";
  position: absolute;
  right: -0.12rem;
  top: 0.35rem;
  width: 0.55rem;
  height: 1.22rem;
  border-radius: 999px;
  background: var(--hair);
  transform: rotate(-8deg);
}

.prepare-customer-eyes {
  position: absolute;
  left: 0.58rem;
  right: 0.58rem;
  top: 1.16rem;
  height: 0.18rem;
  border-radius: 999px;
  background: transparent;
  box-shadow: -0.38rem 0 0 #17202a, 0.38rem 0 0 #17202a;
}

.prepare-customer-mouth {
  position: absolute;
  left: 50%;
  bottom: 0.52rem;
  width: 0.72rem;
  height: 0.34rem;
  border-bottom: 0.13rem solid rgba(73, 33, 22, 0.55);
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.prepare-customer-body {
  position: absolute;
  left: 50%;
  bottom: 0.25rem;
  width: 3.8rem;
  height: 3.62rem;
  border-radius: 1.05rem 1.05rem 0.55rem 0.55rem;
  background: var(--shirt);
  transform: translateX(-50%);
}

.prepare-customer-apron {
  position: absolute;
  left: 0.88rem;
  right: 0.88rem;
  top: 0.62rem;
  bottom: 0.32rem;
  border-radius: 0.45rem 0.45rem 0.25rem 0.25rem;
  background: var(--apron);
}

.prepare-customer-arm {
  position: absolute;
  top: 0.7rem;
  width: 0.62rem;
  height: 2.1rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--shirt) 86%, #ffffff);
}

.prepare-customer-arm.is-left {
  left: -0.18rem;
  transform: rotate(12deg);
}

.prepare-customer-arm.is-right {
  right: -0.18rem;
  transform: rotate(-12deg);
}

.prepare-counter-front {
  position: absolute;
  z-index: 2;
  left: 0.28rem;
  right: 0.28rem;
  bottom: 0;
  height: 1.65rem;
  border-radius: 0.42rem 0.42rem 0.65rem 0.65rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, rgba(50, 35, 29, 0.98), rgba(93, 59, 43, 0.98));
  pointer-events: none;
}

.prepare-workbench {
  position: relative;
  grid-template-columns: minmax(5.8rem, 0.82fr) minmax(0, 1.7fr) minmax(5.8rem, 0.82fr) auto;
  gap: 0.62rem;
  align-items: stretch;
  padding: 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: calc(var(--radius) * 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #2f3a40, #171b1f);
  box-shadow: inset 0 0.22rem 0 rgba(255, 255, 255, 0.08), 0 0.8rem 1.6rem rgba(17, 24, 39, 0.18);
}

.prepare-tool-card,
.prepare-product {
  border-color: rgba(17, 24, 39, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.prepare-tool-card {
  min-height: 6.3rem;
  padding: 0.48rem;
}

.prepare-tool-card strong {
  color: #24292f;
  font-size: 0.78rem;
  line-height: 1;
}

.prepare-tool-visual.prepare-tool-image {
  display: grid;
  place-items: center;
  width: min(100%, 5.8rem);
  height: 4rem;
  aspect-ratio: auto;
  transform: none;
}

.prepare-tool-visual.prepare-tool-image::before,
.prepare-tool-visual.prepare-tool-image::after {
  display: none;
}

.prepare-tool-visual.prepare-tool-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.45rem;
}

.prepare-box-preview {
  min-height: 6.3rem;
}

.prepare-box-art {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 0.25rem;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: calc(var(--radius) * 0.85);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 229, 214, 0.9)),
    #fff;
  padding: 0.48rem;
}

.prepare-box-art img {
  position: absolute;
  inset: 0.1rem;
  width: calc(100% - 0.2rem);
  height: calc(100% - 0.2rem);
  object-fit: contain;
  object-position: center;
  opacity: 0.88;
}

.prepare-box-art strong {
  position: relative;
  z-index: 1;
  justify-self: start;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1;
  overflow: hidden;
  padding: 0.28rem 0.48rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prepare-packed-items {
  position: relative;
  z-index: 1;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.prepare-packed-chip,
.prepare-packed-empty {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #24292f;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.2rem 0.36rem;
  box-shadow: 0 0.25rem 0.6rem rgba(17, 24, 39, 0.09);
}

.prepare-packed-chip b {
  max-width: 5.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prepare-packed-chip .prepare-product-visual {
  width: 1.22rem;
  height: 1.08rem;
  filter: none;
  transform: scale(0.72);
  transform-origin: center;
}

.prepare-inventory {
  gap: 0.42rem;
  padding: 0.48rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: calc(var(--radius) * 0.85);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0)),
    #20262b;
}

.prepare-product {
  min-height: 4.6rem;
  padding: 0.45rem 0.35rem;
}

.prepare-product strong {
  max-width: 100%;
  color: #24292f;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prepare-empty-line {
  position: relative;
  z-index: 1;
  min-height: 9.6rem;
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.42);
  color: #4b5563;
}

.prepare-empty-line span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0.45rem 0.75rem;
}

body[data-theme="dark"] .prepare-stage {
  background:
    linear-gradient(180deg, rgba(29, 42, 45, 0.96) 0 28%, rgba(56, 45, 39, 0.96) 28% 57%, rgba(64, 49, 40, 0.96) 57% 65%, rgba(18, 22, 25, 0.98) 65% 100%),
    #171b1f;
}

body[data-theme="dark"] .prepare-order-bubble,
body[data-theme="dark"] .prepare-tool-card,
body[data-theme="dark"] .prepare-product,
body[data-theme="dark"] .prepare-box-art {
  background: rgba(250, 250, 250, 0.95);
  color: #24292f;
}

@media (max-width: 760px) {
  .prepare-stage {
    grid-template-rows: auto minmax(12.2rem, 1fr) auto auto;
    gap: 0.44rem;
    padding: 0.46rem;
  }

  .prepare-stage::before {
    left: 0.6rem;
    right: 0.6rem;
    top: 2.8rem;
    height: 5.2rem;
  }

  .prepare-customers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 12.2rem;
    gap: 0.3rem;
    padding-inline: 0.12rem;
  }

  .prepare-customers::after {
    left: -0.2rem;
    right: -0.2rem;
    height: 2.05rem;
  }

  .prepare-customer,
  .prepare-customer.is-urgent {
    min-height: 5.9rem;
    grid-template-rows: auto minmax(3.85rem, 1fr);
    gap: 0.12rem;
  }

  .prepare-order-bubble {
    min-height: 3.55rem;
    padding: 0.34rem 0.36rem 0.38rem;
    border-radius: 0.62rem;
  }

  .prepare-bubble-top strong {
    font-size: 0.64rem;
  }

  .prepare-bubble-top small {
    font-size: 0.58rem;
    padding: 0.2rem 0.28rem;
  }

  .prepare-order-items {
    grid-template-columns: repeat(auto-fit, minmax(1.7rem, 1fr));
    gap: 0.12rem;
    margin-top: 0.16rem;
  }

  .prepare-order-item .prepare-product-visual {
    width: 1.36rem;
    height: 1.2rem;
    transform: scale(0.66);
  }

  .prepare-order-item strong {
    font-size: 0.48rem;
  }

  .prepare-order-bubble em {
    height: 0.28rem;
    margin-top: 0.2rem;
  }

  .prepare-customer-person {
    width: 3.5rem;
    height: 4.55rem;
  }

  .prepare-customer-head {
    width: 1.66rem;
    height: 1.82rem;
  }

  .prepare-customer-body {
    width: 2.85rem;
    height: 2.65rem;
  }

  .prepare-customer-eyes {
    left: 0.42rem;
    right: 0.42rem;
    top: 0.85rem;
  }

  .prepare-customer-mouth {
    bottom: 0.38rem;
    width: 0.52rem;
  }

  .prepare-counter-front {
    height: 1.22rem;
  }

  .prepare-workbench {
    grid-template-columns: minmax(4rem, 0.72fr) minmax(0, 1.28fr) minmax(4rem, 0.72fr);
    gap: 0.36rem;
    padding: 0.42rem;
  }

  .prepare-tool-card {
    min-height: 4.8rem;
    padding: 0.34rem;
  }

  .prepare-tool-visual.prepare-tool-image {
    height: 2.7rem;
  }

  .prepare-tool-card strong,
  .prepare-box-art strong {
    font-size: 0.62rem;
  }

  .prepare-box-preview {
    min-height: 4.8rem;
  }

  .prepare-box-art {
    padding: 0.32rem;
  }

  .prepare-packed-chip,
  .prepare-packed-empty {
    font-size: 0.56rem;
    padding: 0.16rem 0.28rem;
  }

  .prepare-packed-chip b {
    max-width: 3.2rem;
  }

  .prepare-inventory {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.28rem;
    padding: 0.34rem;
  }

  .prepare-product {
    min-height: 3.75rem;
    padding: 0.32rem 0.22rem;
  }

  .prepare-product-visual {
    width: 2.05rem;
    height: 1.82rem;
    transform: scale(0.76);
  }

  .prepare-product strong {
    font-size: 0.58rem;
  }

  .prepare-empty-line {
    min-height: 11.2rem;
  }
}

body[data-theme="contrast"] {
  --line: #c5cbc8;
  --paper: #f3f5f4;
  --panel: #ffffff;
  --shadow: 0 18px 44px rgba(14, 18, 18, 0.14);
  --shadow-strong: 0 26px 70px rgba(14, 18, 18, 0.2);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f7f6;
  --muted: #aab3b1;
  --line: #30383a;
  --paper: #101416;
  --panel: #171d1f;
  --soft: rgb(var(--accent-rgb) / 0.16);
  --coral: #ff9a8c;
  --amber: #f4c46d;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --shadow-strong: 0 26px 70px rgba(0, 0, 0, 0.48);
  --shine: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  scroll-padding-bottom: calc(var(--keyboard-safe-bottom) + 7rem);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.14), transparent 22rem),
    repeating-linear-gradient(115deg, rgb(var(--accent-rgb) / 0.052) 0 1px, transparent 1px 4rem),
    repeating-linear-gradient(25deg, rgba(24, 32, 31, 0.04) 0 1px, transparent 1px 5rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), transparent 30rem),
    var(--paper);
  background-attachment: fixed;
  background-size: auto, 78px 78px, 92px 92px, auto, auto;
  color: var(--ink);
  font-family: var(--app-font);
  overflow-x: hidden;
}

body[data-theme="contrast"] {
  background:
    linear-gradient(135deg, rgba(14, 18, 18, 0.11), transparent 22rem),
    linear-gradient(155deg, rgb(var(--accent-rgb) / 0.09), transparent 32rem),
    repeating-linear-gradient(115deg, rgba(14, 18, 18, 0.055) 0 1px, transparent 1px 4rem),
    repeating-linear-gradient(25deg, rgba(24, 32, 31, 0.045) 0 1px, transparent 1px 5rem),
    var(--paper);
}

body[data-theme="dark"] {
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.16), transparent 24rem),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4rem),
    repeating-linear-gradient(25deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 5rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 30rem),
    var(--paper);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(120deg, transparent 0 16%, rgb(var(--accent-rgb) / 0.12) 23%, transparent 31% 100%),
    linear-gradient(78deg, transparent 0 58%, rgba(24, 32, 31, 0.06) 64%, transparent 72% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), transparent 24rem);
  opacity: 0.9;
  transform: translate3d(-18%, 0, 0);
}

body[data-theme="contrast"]::before,
body[data-theme="dark"]::before {
  background:
    linear-gradient(120deg, rgba(16, 20, 22, 0.08), transparent 26%),
    linear-gradient(78deg, transparent 0 56%, rgba(14, 18, 18, 0.14) 64%, transparent 74% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 24rem);
}

body[data-theme="dark"]::before {
  background:
    linear-gradient(120deg, rgb(var(--accent-rgb) / 0.16), transparent 32%),
    linear-gradient(78deg, transparent 0 58%, rgba(255, 255, 255, 0.05) 64%, transparent 74% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24rem);
}

body::after {
  position: fixed;
  inset: auto -12rem -16rem auto;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(45deg, transparent 45%, rgb(var(--accent-rgb) / 0.12) 45% 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, rgba(24, 32, 31, 0.08) 45% 55%, transparent 55%);
  mask-image: linear-gradient(135deg, transparent, black 28%, black 70%, transparent);
  opacity: 0.55;
  transform: rotate(8deg);
}

body[data-theme="dark"]::after {
  background:
    linear-gradient(45deg, transparent 45%, rgb(var(--accent-rgb) / 0.18) 45% 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, rgba(255, 255, 255, 0.08) 45% 55%, transparent 55%);
  opacity: 0.42;
}

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

button {
  cursor: pointer;
}

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

.access-panel.is-submitting button[type="submit"] {
  opacity: 0.85;
}

.access-panel.is-submitting button[type="submit"]::before {
  width: 0.92rem;
  height: 0.92rem;
  margin-right: 0.45rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: button-spin 720ms linear infinite;
}

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

body:not(.is-authenticated) .app-shell {
  display: none;
}

body.is-authenticated .access-screen {
  display: none;
}

#api-status,
body[data-space="client"] [data-brand-tagline] {
  display: none !important;
}

body[data-space="client"] #portal-history-section {
  display: none !important;
}

.access-screen {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1rem 1rem calc(1rem + var(--keyboard-safe-bottom));
}

.access-card {
  position: relative;
  overflow: hidden;
  width: min(76rem, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9)),
    var(--panel);
  padding: clamp(1rem, 4vw, 2rem);
  box-shadow: var(--shadow-strong);
}

.access-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-strong), transparent);
  background-size: 220% 100%;
}

.access-logo {
  width: min(12rem, 52vw);
  height: auto;
  object-fit: contain;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 16px 22px rgb(var(--accent-rgb) / 0.18));
}

.access-subtitle {
  max-width: 44rem;
  margin: 0.6rem auto 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.public-home {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}

.public-home-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--accent-rgb) / 0.045);
  padding: 1rem;
}

.public-home-copy h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
}

.public-home-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.public-home-actions,
.public-product-actions,
.public-catalog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.public-product-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.featured-carousel-shell {
  position: relative;
  isolation: isolate;
}

.featured-carousel-shell::before,
.featured-carousel-shell::after {
  position: absolute;
  top: 0;
  bottom: 0.55rem;
  z-index: 2;
  width: 2.4rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  content: "";
}

.featured-carousel-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--panel), transparent);
}

.featured-carousel-shell::after {
  right: 0;
  background: linear-gradient(270deg, var(--panel), transparent);
}

.featured-carousel-shell.has-overflow::before,
.featured-carousel-shell.has-overflow::after {
  opacity: 0.9;
}

.featured-scroll-button {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.26);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.86);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: 0 0.8rem 2rem rgb(16 20 22 / 0.12);
  transform: translateY(-50%);
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.featured-scroll-button:hover,
.featured-scroll-button:focus-visible {
  background: var(--panel);
  transform: translateY(-50%) scale(1.04);
}

.featured-scroll-button.prev {
  left: 0.35rem;
}

.featured-scroll-button.next {
  right: 0.35rem;
}

.featured-carousel-shell:not(.has-overflow) .featured-scroll-button {
  display: none;
}

.client-featured-products {
  display: flex;
  grid-template-columns: none;
  gap: 0.75rem;
  margin-inline: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0.1rem 0 0.55rem;
  scroll-padding-inline: 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.client-featured-products.is-peeking {
  scroll-behavior: smooth;
}

.client-featured-products .public-product-card {
  flex: 0 0 min(76%, 22rem);
  min-width: min(76%, 22rem);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.client-featured-products .featured-photo-card {
  overflow: hidden;
  padding: 0.45rem;
  background: var(--panel);
}

.featured-photo-button {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: calc(var(--radius) - 0.15rem);
  overflow: hidden;
}

.featured-photo-button .public-product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-photo-chip {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  z-index: 2;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 999px;
  background: rgb(16 20 22 / 0.72);
  color: white;
  padding: 0.3rem 0.6rem;
  font-size: 0.84rem;
  font-weight: 900;
  box-shadow: 0 0.55rem 1.5rem rgb(16 20 22 / 0.18);
}

.featured-photo-caption {
  display: block;
  overflow: hidden;
  padding: 0.45rem 0.15rem 0.05rem;
  color: var(--ink);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 950;
  line-height: 1.12;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-vip-strip {
  display: block;
}

.portal-vip-strip[hidden] {
  display: none !important;
}

.portal-daily-missions {
  display: block;
}

.portal-daily-missions[hidden] {
  display: none !important;
}

.portal-daily-missions .game-daily-missions-card {
  margin: 0;
}

.portal-vip-strip-card {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  border: 1px solid rgb(var(--accent-rgb) / 0.22);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 0.7rem 1.6rem rgba(35, 28, 44, 0.07);
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0.65rem 0.75rem;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.portal-vip-strip-card:hover,
.portal-vip-strip-card:focus-visible {
  border-color: rgb(var(--accent-rgb) / 0.45);
  box-shadow: 0 0.9rem 2rem rgba(35, 28, 44, 0.1);
  transform: translateY(-1px);
}

.portal-vip-strip-card:focus-visible {
  outline: 3px solid rgb(var(--accent-rgb) / 0.25);
  outline-offset: 3px;
}

.portal-vip-strip-head,
.portal-vip-strip-foot {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.76rem;
  font-weight: 800;
  gap: 0.65rem;
  justify-content: space-between;
  line-height: 1.2;
}

.portal-vip-progress-row {
  align-items: center;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.portal-vip-progress-row strong {
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.portal-vip-progress-track {
  background: rgb(var(--accent-rgb) / 0.14);
  border-radius: 999px;
  height: 0.56rem;
  overflow: hidden;
  position: relative;
}

.portal-vip-progress-track span {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: inherit;
  bottom: 0;
  left: 0;
  position: absolute;
  top: 0;
}

.portal-vip-strip-card small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.public-product-card {
  display: grid;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.65rem;
  min-width: 0;
}

.catalog-load-more {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.catalog-load-more:empty {
  display: none;
}

.public-product-photo {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.public-product-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--soft);
}

.public-product-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.public-product-info {
  display: grid;
  gap: 0.2rem;
}

.public-product-info strong,
.public-product-info span,
.public-product-info small {
  overflow-wrap: anywhere;
}

.public-product-info small {
  color: var(--muted);
}

.product-editor-modal,
.product-variant-modal,
.price-calculator-modal,
.product-tags-modal,
.public-catalog-modal,
.business-invoice-modal,
.business-prep-modal,
.client-form-modal,
.client-message-modal,
.client-cart-modal,
.client-invoices-modal,
.leaderboard-participant-modal,
.client-notifications-modal {
  position: fixed;
  inset: 0;
  z-index: 1240;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.product-editor-modal[hidden],
.product-variant-modal[hidden],
.price-calculator-modal[hidden],
.product-tags-modal[hidden],
.public-catalog-modal[hidden],
.business-invoice-modal[hidden],
.business-prep-modal[hidden],
.client-form-modal[hidden],
.client-message-modal[hidden],
.client-cart-modal[hidden],
.client-invoices-modal[hidden],
.leaderboard-participant-modal[hidden],
.client-notifications-modal[hidden] {
  display: none !important;
}

.product-editor-backdrop,
.product-variant-backdrop,
.price-calculator-backdrop,
.product-tags-backdrop,
.public-catalog-backdrop,
.business-invoice-backdrop,
.business-prep-backdrop,
.client-form-backdrop,
.client-message-backdrop,
.client-cart-backdrop,
.client-invoices-backdrop,
.leaderboard-participant-backdrop,
.client-notifications-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 12%, rgb(var(--accent-rgb) / 0.16), transparent 34rem),
    rgba(16, 20, 22, 0.5);
  backdrop-filter: blur(6px);
}

.product-editor-panel,
.product-variant-panel,
.price-calculator-panel,
.product-tags-panel,
.public-catalog-panel,
.business-invoice-panel,
.business-prep-panel,
.client-form-dialog,
.client-message-panel,
.client-cart-panel,
.client-invoices-panel,
.leaderboard-participant-panel,
.client-notifications-panel {
  position: relative;
  width: min(72rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 34%, rgba(255, 255, 255, 0.88));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), transparent 14rem),
    var(--panel);
  box-shadow:
    0 1.4rem 4rem rgba(10, 18, 18, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.64) inset;
  padding: 1rem;
}

.client-cart-panel {
  width: min(44rem, 100%);
}

.client-top-cart-button {
  order: -1;
}

.product-editor-panel::before,
.product-variant-panel::before,
.price-calculator-panel::before,
.product-tags-panel::before,
.public-catalog-panel::before,
.business-invoice-panel::before,
.business-prep-panel::before,
.client-form-dialog::before,
.client-message-panel::before,
.client-cart-panel::before,
.client-invoices-panel::before,
.leaderboard-participant-panel::before,
.client-notifications-panel::before {
  position: absolute;
  inset: 0.42rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.12);
  border-radius: calc(var(--radius) - 0.42rem);
  pointer-events: none;
  content: "";
}

.product-editor-panel > .panel-heading,
.product-variant-panel > .panel-heading,
.price-calculator-panel > .panel-heading,
.product-tags-panel > .panel-heading,
.public-catalog-panel > .panel-heading,
.business-invoice-panel > .panel-heading,
.business-prep-panel > .panel-heading,
.client-form-dialog > .panel-heading,
.client-message-panel > .panel-heading,
.client-cart-panel > .panel-heading,
.client-invoices-panel > .panel-heading,
.leaderboard-participant-panel > .panel-heading,
.client-notifications-panel > .panel-heading {
  padding-right: 3.25rem;
}

.product-editor-panel > .panel-heading > .icon-button[data-action^="close-"],
.product-variant-panel > .panel-heading > .icon-button[data-action^="close-"],
.price-calculator-panel > .panel-heading > .icon-button[data-action^="close-"],
.product-tags-panel > .panel-heading > .icon-button[data-action^="close-"],
.public-catalog-panel > .panel-heading > .icon-button[data-action^="close-"],
.business-invoice-panel > .panel-heading > .icon-button[data-action^="close-"],
.client-form-dialog > .panel-heading > .icon-button,
.client-message-panel > .panel-heading > .icon-button[data-action^="close-"],
.client-invoices-panel > .panel-heading > .icon-button[data-action^="close-"],
.leaderboard-participant-panel > .panel-heading > .icon-button[data-action^="close-"],
.client-notifications-panel > .panel-heading > .icon-button[data-action^="close-"] {
  position: absolute;
  top: 0.78rem;
  right: 0.78rem;
  z-index: 2;
  width: 2.35rem;
  height: 2.35rem;
  border-color: color-mix(in srgb, var(--brand-primary) 30%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--panel) 84%, var(--brand-soft)));
  box-shadow: 0 0.45rem 1.1rem rgba(16, 20, 22, 0.14);
}

.product-editor-panel {
  width: min(76rem, 100%);
}

.product-variant-modal {
  z-index: 1260;
}

.product-variant-panel {
  width: min(36rem, 100%);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.field-label-row .field-label {
  margin: 0;
}

.product-variant-add {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

.product-variant-list {
  display: grid;
  gap: 0.55rem;
}

.product-variant-chip {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, var(--line));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--panel) 90%, var(--soft));
  padding: 0.55rem;
}

.product-variant-thumb,
.product-variant-photo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.68rem;
  background: #fff;
}

.product-variant-thumb {
  width: 3.4rem;
  height: 3.4rem;
  color: var(--muted);
  font-weight: 900;
}

.product-variant-thumb img,
.product-variant-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-variant-chip-body {
  display: grid;
  min-width: 0;
  gap: 0.16rem;
}

.product-variant-chip-body strong,
.product-variant-chip-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-variant-chip-body small {
  color: var(--muted);
  font-weight: 700;
}

.product-variant-photo-field {
  display: grid;
  grid-template-columns: minmax(11rem, 0.8fr) minmax(8rem, 1fr) auto;
  align-items: stretch;
  gap: 0.7rem;
}

.product-variant-photo-preview {
  min-height: 7rem;
  color: var(--muted);
  font-weight: 800;
}

.inventory-variant-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.inventory-variant-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 88%, var(--soft));
  padding: 0.18rem 0.58rem 0.18rem 0.22rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.inventory-variant-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.inventory-variant-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-editor-mode-switch {
  position: relative;
  z-index: 1;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  width: min(26rem, 100%);
  margin: 0 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 84%, var(--soft));
  padding: 0.22rem;
}

.product-editor-mode-switch button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.product-editor-mode-switch button.is-active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 0.35rem 0.85rem rgba(16, 20, 22, 0.14);
}

.product-editor-mode-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.product-editor-bulk textarea {
  min-height: 12rem;
  font-family: inherit;
}

.product-photo-first {
  display: grid;
  grid-template-columns: minmax(12rem, 0.55fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), transparent 64%),
    color-mix(in srgb, var(--panel) 88%, var(--soft));
  padding: 0.8rem;
}

.product-photo-upload-label {
  align-content: start;
  min-height: 100%;
}

.product-photo-first .product-photo-editor {
  align-content: start;
}

.price-input-card {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.product-discount-fields {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.price-input-card .ghost-button {
  justify-self: start;
  min-height: 2.05rem;
  padding-inline: 0.72rem;
}

.price-calculator-panel {
  width: min(54rem, 100%);
}

.price-calculator-form label[hidden] {
  display: none !important;
}

.price-calculator-intro,
.price-calculator-lot-card {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 24%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), transparent 70%),
    rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  padding: 0.78rem;
}

.price-calculator-intro {
  display: grid;
  gap: 0.18rem;
}

.price-calculator-intro strong,
.price-calculator-lot-heading strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.price-calculator-intro span,
.price-calculator-lot-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.price-calculator-lot-card {
  display: grid;
  gap: 0.7rem;
}

.price-calculator-lot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.price-calculator-lot-heading > div {
  display: grid;
  gap: 0.12rem;
}

.price-calculator-lines {
  display: grid;
  gap: 0.55rem;
}

.price-calculator-line {
  display: grid;
  grid-template-columns: minmax(5rem, 0.55fr) minmax(10rem, 1.5fr) minmax(4.5rem, 0.55fr) minmax(6rem, 0.8fr) minmax(6rem, 0.8fr) auto;
  align-items: end;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.15rem);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.58rem;
}

.price-calculator-line label {
  gap: 0.24rem;
}

.price-calculator-line-photo {
  display: grid;
  align-self: stretch;
}

.price-calculator-line-photo input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.price-calculator-line-photo-preview {
  display: grid;
  place-items: center;
  min-height: 4.6rem;
  border: 1px dashed color-mix(in srgb, var(--brand-primary) 36%, var(--line));
  border-radius: calc(var(--radius) - 0.25rem);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
}

.price-calculator-line-photo-preview img {
  width: 100%;
  height: 100%;
  min-height: 4.6rem;
  object-fit: cover;
}

.price-calculator-line input {
  min-height: 2.25rem;
}

.price-calculator-remove-line {
  align-self: center;
  width: 2.2rem;
  height: 2.2rem;
}

.price-calculator-line-output {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.price-calculator-line-output span {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.22rem 0.48rem;
}

.price-calculator-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.6rem;
}

.price-calculator-result article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.7rem;
}

.price-calculator-result span,
.price-calculator-result small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.price-calculator-result strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
}

.product-switch-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.78);
  padding: 0.8rem 0.9rem;
}

.product-switch-copy {
  display: grid;
  gap: 0.18rem;
}

.product-switch-copy strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.product-switch-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.product-switch-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-switch-line i {
  position: relative;
  width: 3rem;
  height: 1.65rem;
  border-radius: 999px;
  background: #e8e2ea;
  border: 1px solid rgba(73, 60, 85, 0.15);
  box-shadow: inset 0 0.1rem 0.35rem rgba(28, 24, 34, 0.12);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.product-switch-line i::after {
  content: "";
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0.2rem 0.55rem rgba(32, 27, 40, 0.2);
  transition: transform 0.18s ease;
}

.product-switch-line input:checked + i {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: rgb(var(--accent-rgb) / 0.38);
}

.product-switch-line input:checked + i::after {
  transform: translateX(1.35rem);
}

.product-switch-line:focus-within {
  outline: 2px solid rgb(var(--accent-rgb) / 0.34);
  outline-offset: 2px;
}

.inventory-add-button {
  min-height: 2.35rem;
  padding-inline: 0.8rem;
}

.client-reward-info-panel {
  width: min(36rem, 100%);
}

.client-reward-info-body {
  display: grid;
  gap: 0.8rem;
}

.client-reward-info-body ul {
  margin: 0;
  padding-left: 1.1rem;
}

.client-reward-info-panel {
  overflow: hidden;
  padding: 0;
}

.client-reward-info-panel .panel-heading {
  align-items: center;
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.12), transparent 68%),
    var(--panel);
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 1rem;
}

.client-reward-info-body {
  padding: 1rem;
}

.reward-info-card {
  display: grid;
  gap: 0.9rem;
}

.reward-info-hero {
  display: grid;
  grid-template-columns: 3.3rem minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  border-radius: calc(var(--radius) - 0.25rem);
  background:
    radial-gradient(circle at top left, rgb(var(--accent-rgb) / 0.18), transparent 45%),
    linear-gradient(135deg, var(--panel), color-mix(in srgb, var(--panel) 84%, var(--brand-soft)));
  padding: 0.95rem;
  box-shadow: 0 1rem 2.4rem rgba(30, 42, 38, 0.1);
}

.reward-info-icon {
  display: inline-grid;
  place-items: center;
  width: 3.3rem;
  height: 3.3rem;
  border: 1px solid rgba(16, 20, 22, 0.16);
  border-radius: 1.1rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--accent-strong));
  color: white;
  font-weight: 950;
  box-shadow: 0 0.85rem 1.7rem rgb(var(--accent-rgb) / 0.22);
}

.reward-info-icon-coin {
  overflow: hidden;
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.78), transparent 26%),
    linear-gradient(135deg, color-mix(in srgb, #fff8c9 72%, var(--panel)), color-mix(in srgb, #f6c343 72%, var(--accent-strong)));
  padding: 0.34rem;
}

.reward-info-icon-coin img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.2rem 0.32rem rgba(112, 73, 0, 0.24));
}

.reward-info-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reward-info-amount {
  display: block;
  margin: 0.08rem 0 0.25rem;
  color: var(--ink);
  font-size: clamp(1.8rem, 8vw, 2.7rem);
  line-height: 1;
}

.credit-value-stack,
.client-credit-stack {
  display: inline-grid;
  gap: 0.08rem;
  min-width: 0;
  line-height: 1.05;
}

.credit-value-main,
.client-credit-stack strong {
  color: var(--ink);
  font-size: clamp(1.1rem, 4vw, 1.55rem);
  font-weight: 950;
}

.credit-value-sub,
.client-credit-stack small,
.record-credit-equivalent {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.credit-value-stack.is-compact .credit-value-main,
.client-credit-stack.is-compact strong {
  font-size: 1rem;
}

.credit-value-icon {
  font-size: 1rem;
}

.reward-info-hero p,
.reward-info-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.reward-info-rules,
.reward-info-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.reward-info-rules span,
.reward-info-split span {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--panel) 88%, var(--brand-soft));
  padding: 0.7rem;
  font-weight: 850;
}

.reward-info-split span {
  display: grid;
  gap: 0.12rem;
}

.reward-info-split small {
  color: var(--muted);
  font-weight: 800;
}

.reward-info-note {
  border-left: 3px solid var(--brand-primary);
  background: color-mix(in srgb, var(--panel) 90%, var(--brand-soft));
  border-radius: 0.7rem;
  padding: 0.75rem;
}

.client-history-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 10rem));
  align-items: end;
  justify-content: end;
}

.client-history-filters .compact-label {
  min-width: 0;
}

.public-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.access-legal {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  text-align: center;
}

.install-button {
  min-width: min(18rem, 100%);
}

.access-legal a {
  color: var(--muted);
  font-size: 0.84rem;
  text-decoration: none;
}

.access-legal a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.developer-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: color-mix(in srgb, var(--muted) 82%, var(--ink));
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0.66;
}

.access-screen .developer-credit {
  position: fixed;
  left: 50%;
  bottom: max(0.7rem, env(safe-area-inset-bottom));
  z-index: 8;
  transform: translateX(-50%);
  padding: 0.28rem 0.52rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 0.65rem 1.6rem rgba(24, 32, 31, 0.11);
  opacity: 0.78;
  backdrop-filter: blur(10px);
}

.developer-credit img {
  display: block;
  width: 4.25rem;
  max-height: 1rem;
  object-fit: contain;
}

.access-screen .developer-credit img {
  filter: grayscale(1) saturate(0) contrast(0.92);
  opacity: 0.62;
}

.nav-developer-credit {
  justify-content: flex-start;
  width: 100%;
  margin-top: 0.1rem;
  padding: 0.15rem 0.1rem 0;
}

.nav-developer-credit img {
  width: 3.8rem;
  max-height: 0.9rem;
}

body[data-theme="contrast"] .developer-credit,
body[data-theme="dark"] .developer-credit {
  color: rgba(255, 255, 255, 0.64);
}

body[data-theme="contrast"] .access-screen .developer-credit,
body[data-theme="dark"] .access-screen .developer-credit {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(24, 32, 31, 0.76);
}

body[data-theme="contrast"] .developer-credit img,
body[data-theme="dark"] .developer-credit img {
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.language-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.access-language-menu {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
}

.legal-language-menu {
  position: fixed;
  top: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-top));
  right: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-right));
  z-index: 70;
}

.nav-language-menu {
  display: block;
  width: 100%;
}

.nav-utilities .nav-language-menu {
  display: none;
}

.nav-brand-language-menu {
  align-self: flex-start;
  flex: 0 0 auto;
  margin-left: auto;
  z-index: 4;
}

.nav-brand-language-menu .language-trigger {
  min-width: 2.65rem;
  background: #ffffff;
  color: #18201f;
}

.nav-brand-language-menu [data-language-current] {
  display: block;
  min-width: 1.25rem;
  color: #18201f !important;
  line-height: 1;
}

.language-trigger {
  display: inline-grid;
  place-items: center;
  min-width: 2.6rem;
  min-height: 2.1rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.22);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  padding: 0.25rem 0.65rem;
  box-shadow: 0 10px 24px rgba(30, 42, 38, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-language-menu .language-trigger {
  display: flex;
  justify-content: space-between;
  text-transform: none;
}

.nav-language-menu .language-trigger strong {
  text-transform: uppercase;
}

.nav-language-menu .language-popover {
  width: 100%;
}

.nav-brand-language-menu .language-popover {
  min-width: 7.2rem;
}

.language-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0.25rem;
}

.language-popover button {
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 800;
}

.language-popover button:hover,
.language-popover button.is-active {
  background: var(--soft);
  color: var(--accent-strong);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.access-panel {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62)),
    var(--paper);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.access-maintenance {
  text-align: left;
  border-color: rgba(186, 127, 74, 0.34);
  box-shadow: 0 18px 44px rgba(63, 39, 24, 0.12);
}

.access-maintenance h2,
.access-maintenance p {
  margin: 0;
}

.access-maintenance p {
  color: var(--muted);
  line-height: 1.55;
}

body[data-space="client"] [data-enterprise-only],
body[data-space="client"] [data-action="portal-confirm-request"] {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), transparent 18rem);
  backdrop-filter: blur(14px);
  padding: 1rem;
  box-shadow: 8px 0 34px rgba(30, 42, 38, 0.06);
}

body[data-theme="contrast"] .sidebar {
  border-right-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(18, 22, 23, 0.97), rgba(18, 22, 23, 0.88)),
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.22), transparent 18rem);
  box-shadow: 10px 0 36px rgba(14, 18, 18, 0.18);
}

body[data-theme="contrast"] .brand strong,
body[data-theme="contrast"] .brand span,
body[data-theme="contrast"] .nav-item {
  color: rgba(255, 255, 255, 0.88);
}

body[data-theme="contrast"] .brand span {
  color: rgba(255, 255, 255, 0.62);
}

body[data-theme="contrast"] .nav-item:hover,
body[data-theme="contrast"] .nav-item.is-active {
  border-color: rgb(var(--accent-rgb) / 0.46);
  background: rgb(var(--accent-rgb) / 0.18);
}

body[data-theme="dark"] .sidebar {
  border-right-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(13, 16, 18, 0.98), rgba(13, 16, 18, 0.9)),
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.18), transparent 18rem);
  box-shadow: 10px 0 36px rgba(0, 0, 0, 0.35);
}

.menu-toggle,
.nav-backdrop {
  display: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.menu-toggle {
  display: none;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: 4rem;
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 4.5rem;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgb(var(--accent-rgb) / 0.14));
}

.brand-logo.is-client-profile {
  width: 3.8rem;
  height: 3.8rem;
  border: 2px solid rgb(var(--accent-rgb) / 0.28);
  border-radius: 999px;
  background: var(--panel);
  object-fit: cover;
}

.logo-home-button {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  line-height: 0;
}

.logo-home-button:focus-visible {
  outline: 3px solid rgb(var(--accent-rgb) / 0.35);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.logo-home-button:hover .brand-logo,
.logo-home-button:hover .topbar-logo {
  transform: translateY(-1px) scale(1.02);
}

.logo-home-button .brand-logo,
.logo-home-button .topbar-logo {
  transition: transform 150ms ease, filter 150ms ease;
}

.logo-home-button.is-client-profile-frame {
  position: relative;
  isolation: isolate;
  border-radius: 999px;
}

.logo-home-button.is-client-profile-frame::before {
  position: absolute;
  inset: -0.28rem;
  z-index: -1;
  display: none;
  border-radius: 999px;
  background: var(--line);
  content: "";
}

.logo-home-button.is-client-profile-frame[data-plan="vip"]::before {
  display: block;
  background: conic-gradient(from 150deg, var(--accent), #2d0b35, #f2c94c, var(--accent));
  box-shadow: 0 0 0.8rem rgb(var(--accent-rgb) / 0.28);
}

.logo-home-button.is-client-profile-frame[data-plan="vendeur"]::before {
  display: block;
  background: conic-gradient(from 150deg, #8f98a8, #f8fafc, #cbd5e1, #64748b, #f8fafc, #8f98a8);
  box-shadow: 0 0 0.8rem rgba(100, 116, 139, 0.24);
}

.logo-home-button.is-client-profile-frame[data-plan="vendeur_pro"]::before {
  display: block;
  background: conic-gradient(from 150deg, #050505, #b58b2a, #fff0b3, #050505);
}

.nav-client-plan-ribbon {
  position: absolute;
  right: 50%;
  bottom: -0.58rem;
  transform: translateX(50%);
  border: 1px solid rgba(24, 22, 28, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #15131a;
  padding: 0.12rem 0.42rem;
  box-shadow: 0 0.4rem 0.9rem rgba(24, 22, 28, 0.14);
  font-size: 0.56rem;
  font-weight: 950;
  line-height: 1.1;
  text-shadow: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo-home-button.is-client-profile-frame[data-plan="vip"] .nav-client-plan-ribbon {
  border-color: rgb(var(--accent-rgb) / 0.32);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.logo-home-button.is-client-profile-frame[data-plan="vendeur"] .nav-client-plan-ribbon {
  border-color: rgba(100, 116, 139, 0.34);
  background: #f8fafc;
  color: #334155;
}

.logo-home-button.is-client-profile-frame[data-plan="vendeur_pro"] .nav-client-plan-ribbon {
  border-color: rgba(181, 139, 42, 0.48);
  background: #050505;
  color: #ffe49a;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

.brand .nav-client-plan-ribbon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.45rem;
  min-height: 1rem;
  margin-top: 0;
  color: #15131a;
  font-size: 0.56rem;
}

.brand .logo-home-button.is-client-profile-frame[data-plan="vip"] .nav-client-plan-ribbon {
  color: #fff;
}

.brand .logo-home-button.is-client-profile-frame[data-plan="vendeur"] .nav-client-plan-ribbon {
  color: #334155;
}

.brand .logo-home-button.is-client-profile-frame[data-plan="vendeur_pro"] .nav-client-plan-ribbon {
  color: #ffe49a;
}

body[data-theme="contrast"] .brand .nav-client-plan-ribbon,
body[data-theme="dark"] .brand .nav-client-plan-ribbon {
  color: #15131a;
}

body[data-theme="contrast"] .brand .logo-home-button.is-client-profile-frame[data-plan="vip"] .nav-client-plan-ribbon,
body[data-theme="dark"] .brand .logo-home-button.is-client-profile-frame[data-plan="vip"] .nav-client-plan-ribbon {
  color: #fff;
}

body[data-theme="contrast"] .brand .logo-home-button.is-client-profile-frame[data-plan="vendeur"] .nav-client-plan-ribbon,
body[data-theme="dark"] .brand .logo-home-button.is-client-profile-frame[data-plan="vendeur"] .nav-client-plan-ribbon {
  background: #334155;
  color: #e2e8f0;
}

body[data-theme="contrast"] .brand .logo-home-button.is-client-profile-frame[data-plan="vendeur_pro"] .nav-client-plan-ribbon,
body[data-theme="dark"] .brand .logo-home-button.is-client-profile-frame[data-plan="vendeur_pro"] .nav-client-plan-ribbon {
  color: #ffe49a;
}

.nav-list {
  display: grid;
  gap: 0.35rem;
}

.nav-utilities {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.nav-utilities button,
.nav-utilities select,
.nav-language-picker {
  width: 100%;
}

.nav-language-picker {
  text-align: left;
}

.nav-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 0.55rem 0.7rem;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.nav-item::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(110deg, transparent 0 36%, var(--shine) 48%, transparent 60% 100%);
  opacity: 0;
  transform: translateX(-100%);
}

.nav-item span:first-child {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgb(var(--accent-rgb) / 0.28);
  background: var(--soft);
}

.nav-item.is-active {
  box-shadow: 0 12px 26px rgb(var(--accent-rgb) / 0.12);
}

.nav-item.is-active span:first-child {
  background: var(--accent);
  color: white;
}

.nav-badge {
  justify-self: end;
  min-width: 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--panel);
  padding: 0.12rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}

.nav-item.is-active .nav-badge {
  background: var(--accent-strong);
  color: #fff;
}

.workspace {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding: 1.4rem;
  padding-bottom: calc(1.4rem + var(--keyboard-safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  margin-inline: -0.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.92), rgb(255 255 255 / 0.78)),
    var(--paper);
  padding: 0.45rem 0.35rem;
  backdrop-filter: blur(14px);
}

body[data-theme="dark"] .topbar {
  background:
    linear-gradient(180deg, rgb(23 29 31 / 0.94), rgb(23 29 31 / 0.78)),
    var(--paper);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.topbar-title > div {
  min-width: 0;
}

.topbar-logo {
  width: 5.75rem;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgb(var(--accent-rgb) / 0.15));
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.75rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.topbar-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.client-top-icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.45rem;
  min-width: 2.45rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 94%, var(--brand-soft));
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: 0 0.55rem 1.2rem rgba(35, 28, 44, 0.08);
}

.client-top-icon-button[hidden] {
  display: none !important;
}

.client-top-icon-button .nav-badge {
  position: absolute;
  top: -0.28rem;
  right: -0.28rem;
  min-width: 1.1rem;
  padding: 0.08rem 0.3rem;
  font-size: 0.64rem;
  line-height: 1.05;
}

.client-top-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  min-height: 2.25rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.22);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  padding: 0.28rem 0.7rem;
  box-shadow: 0 10px 24px rgba(30, 42, 38, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.client-top-summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
}

.client-top-summary strong {
  color: var(--ink);
}

.client-top-summary .client-credit-stack {
  display: inline-grid;
  align-items: center;
  gap: 0.06rem;
}

.client-top-summary .client-credit-stack strong {
  font-size: 0.86rem;
}

.client-top-summary .client-credit-stack small {
  font-size: 0.64rem;
}

.client-top-summary[data-has-credit="true"] {
  border-color: rgb(var(--accent-rgb) / 0.36);
  background: linear-gradient(135deg, var(--soft), var(--panel));
}

.topbar-client-summary {
  display: inline-grid;
  justify-items: center;
  min-height: 0;
  gap: 0.08rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 0.68rem;
  box-shadow: none;
  line-height: 1.05;
}

.topbar-client-summary[data-has-credit="true"] {
  border-color: transparent;
  background: transparent;
}

.topbar-client-summary .client-credit-label {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-client-summary .client-credit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 1.55rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.3);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--soft), var(--panel));
  padding: 0.16rem 0.32rem;
  box-shadow: 0 0.45rem 1rem rgb(var(--accent-rgb) / 0.08);
}

.topbar-client-summary .client-credit-pill strong {
  overflow: hidden;
  max-width: 8.5rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-client-summary .client-credit-coin {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  filter: drop-shadow(0 0.16rem 0.32rem rgba(118, 76, 0, 0.2));
}

.topbar-client-summary .client-credit-coin img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar-client-summary .client-credit-equivalent,
.nav-client-summary .nav-summary-equivalent {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1;
}

.nav-client-summary {
  width: auto;
  max-width: none;
  min-height: auto;
  justify-content: flex-start;
  gap: 0.4rem;
  margin: -0.7rem 0 0.65rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 0.15rem;
  box-shadow: none;
  font-size: 0.72rem;
  text-align: left;
}

.nav-client-summary[data-has-credit="true"] {
  border-color: transparent;
  background: transparent;
}

.nav-client-summary span {
  justify-content: flex-start;
}

.sidebar .nav-client-summary span {
  color: rgba(255, 255, 255, 0.64);
}

.sidebar .nav-client-summary strong {
  color: rgba(255, 255, 255, 0.96);
}

.nav-client-summary .nav-summary-label,
.nav-client-summary .nav-summary-value {
  width: auto;
  flex: 0 0 auto;
}

.nav-client-summary .nav-summary-value {
  font-size: 0.82rem;
  letter-spacing: 0;
}

.nav-client-summary .nav-summary-equivalent {
  color: rgba(255, 255, 255, 0.68);
}

.delivery-date-field {
  display: grid;
  gap: 0.25rem;
  min-width: 10rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 1rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

button.metric {
  width: 100%;
  color: inherit;
  text-align: left;
}

.metric.is-clickable {
  cursor: pointer;
}

.metric.is-clickable:hover,
.metric.is-clickable:focus-visible {
  border-color: rgb(var(--accent-rgb) / 0.42);
  box-shadow: var(--shadow);
  outline: none;
}

.metric {
  position: relative;
  min-height: 7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.88)),
    var(--panel);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric::after {
  position: absolute;
  inset: 0 0 auto auto;
  width: 4.8rem;
  height: 0.32rem;
  border-radius: 0 var(--radius) 0 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgb(var(--accent-rgb) / 0.5));
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
  opacity: 0.75;
}

.metric span {
  color: var(--muted);
  font-size: 0.85rem;
}

.metric strong {
  display: block;
  margin-top: 0.65rem;
  font-size: 1.7rem;
}

.metric small {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
}

.metric.warn {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
}

.metric.warn::after {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--amber) 72%, var(--accent)));
}

.metric.live {
  border-color: color-mix(in srgb, var(--success) 38%, var(--line));
}

.metric.live::after {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--success) 76%, var(--accent)));
}

.inventory-summary-grid {
  grid-template-columns: repeat(5, minmax(8.8rem, 1fr));
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}

.inventory-summary-grid .metric {
  min-height: 4.6rem;
  padding: 0.62rem 0.72rem;
}

.inventory-summary-grid .metric::after {
  width: 3.2rem;
  height: 0.22rem;
}

.inventory-summary-grid .metric span {
  font-size: 0.72rem;
  font-weight: 800;
}

.inventory-summary-grid .metric strong {
  margin-top: 0.32rem;
  font-size: clamp(1rem, 1.8vw, 1.28rem);
}

.inventory-summary-grid .metric small {
  margin-top: 0.22rem;
  font-size: 0.68rem;
}

.inventory-primary-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: -0.2rem;
}

.inventory-add-primary {
  width: auto;
  min-height: 2.45rem;
  padding-inline: 0.95rem;
  border-radius: 999px;
}

.command-center-panel .panel-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.command-sales-counter {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  gap: 0.08rem 0.55rem;
  align-items: center;
  min-width: 9.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.52rem 0.82rem;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 0.45rem 1.1rem rgba(30, 42, 38, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.command-sales-counter:hover,
.command-sales-counter:focus-visible {
  border-color: rgb(var(--accent-rgb) / 0.42);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-1px);
}

.command-sales-counter span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.command-sales-counter strong {
  font-size: 1.18rem;
  line-height: 1;
}

.command-sales-counter small {
  justify-self: end;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.command-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.command-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.18rem 0.65rem;
  align-items: start;
  min-height: 5.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    var(--panel);
  padding: 0.85rem;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 0.55rem 1.4rem rgba(30, 42, 38, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.command-action:hover,
.command-action:focus-visible {
  border-color: rgb(var(--accent-rgb) / 0.46);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-1px);
}

.command-action > span {
  display: inline-grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 950;
}

.command-action strong,
.command-action small {
  min-width: 0;
}

.command-action strong {
  align-self: end;
  font-size: 0.95rem;
  line-height: 1.2;
}

.command-action small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.32;
}

.command-action.is-primary {
  border-color: rgb(var(--accent-rgb) / 0.38);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.14), rgba(255, 255, 255, 0.9)),
    var(--panel);
}

.command-action.is-primary > span {
  background: var(--accent);
  color: white;
}

@media (max-width: 1180px) {
  .command-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.business-control-panel .panel-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.business-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.client-contact-inbox-panel .panel-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.client-contact-message-record {
  padding: 0.75rem;
}

.client-contact-message-record.is-unread {
  border-color: rgb(var(--accent-rgb) / 0.38);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.08);
}

.client-contact-message-preview {
  display: -webkit-box;
  margin: 0.42rem 0 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.business-control-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  min-height: 5.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.82rem;
  color: inherit;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.business-control-item:hover,
.business-control-item:focus-visible {
  border-color: rgb(var(--accent-rgb) / 0.4);
  box-shadow: var(--shadow);
  outline: none;
}

.business-control-item.is-on {
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
}

.business-control-item.is-off {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
}

.business-control-switch {
  position: relative;
  width: 3rem;
  height: 1.58rem;
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--success) 20%, white);
  transition: background 160ms ease, border-color 160ms ease;
}

.business-control-switch i {
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  width: 1.16rem;
  height: 1.16rem;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0.16rem 0.38rem rgba(12, 22, 18, 0.22);
  transition: transform 160ms ease, background 160ms ease;
}

.business-control-item.is-off .business-control-switch {
  border-color: color-mix(in srgb, var(--amber) 48%, var(--line));
  background: color-mix(in srgb, var(--amber) 18%, white);
}

.business-control-item.is-off .business-control-switch i {
  background: var(--amber);
  transform: translateX(-1.42rem);
}

.business-control-item strong,
.business-control-item small {
  display: block;
}

.business-control-item strong {
  font-size: 0.95rem;
}

.business-control-item small {
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.portal-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-metrics .metric {
  min-height: 5.75rem;
  padding: 0.78rem;
}

.portal-metrics .metric strong {
  margin-top: 0.45rem;
  overflow-wrap: anywhere;
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
}

.portal-metrics .metric small {
  margin-top: 0.3rem;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: start;
}

.live-layout {
  grid-template-columns: minmax(20rem, 0.75fr) minmax(0, 1.25fr);
}

.live-sale-heading {
  align-items: center;
}

.live-mode-menu {
  z-index: 5;
}

.live-mode-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-width: 8rem;
  min-height: 2.25rem;
  text-transform: none;
}

.live-mode-trigger::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.58;
  transform: translateY(-0.12rem) rotate(45deg);
}

.live-mode-popover {
  min-width: 10.25rem;
}

.live-quantity-stepper {
  grid-template-columns: 2.25rem minmax(4rem, 1fr) 2.25rem;
}

.live-quantity-stepper input {
  min-width: 0;
  text-align: center;
}

.live-mode-panel {
  display: none;
  gap: 0.85rem;
}

.live-mode-panel.is-active {
  display: grid;
}

.prep-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 0.75fr);
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9)),
    rgba(255, 255, 255, 0.94);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.36), transparent 72%);
  opacity: 0.85;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.product-panel-heading {
  align-items: center;
  flex-direction: row;
}

.product-code-badge {
  flex: 0 0 auto;
  max-width: 42%;
  color: color-mix(in srgb, var(--muted) 84%, var(--ink));
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.compact-label {
  min-width: min(14rem, 100%);
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 0.65rem 0.75rem;
}

textarea {
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: color-mix(in srgb, var(--soft) 82%, #ffffff);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(var(--accent-rgb) / 0.16);
  scroll-margin-block: calc(var(--keyboard-safe-bottom) + 7rem);
}

.product-search-input,
.client-search-input {
  min-height: 2.38rem;
  border-color: color-mix(in srgb, var(--line) 74%, var(--accent));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    var(--soft);
  font-size: 0.88rem;
}

.product-identity-field {
  display: block;
}

.product-identity-field label {
  min-width: 0;
}

.product-category-field {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.product-tags-field {
  display: grid;
  gap: 0.6rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
    var(--soft);
}

.product-tags-open-button {
  justify-self: start;
  min-height: 2.65rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 30%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 14%, white), white);
  color: var(--ink);
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0.45rem 1rem rgba(15, 23, 42, 0.08);
}

.product-tags-open-button.is-missing {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  box-shadow:
    0 0.45rem 1rem rgba(15, 23, 42, 0.08),
    0 0 0 3px rgb(var(--accent-rgb) / 0.13);
}

.product-tags-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 2.35rem;
  align-items: center;
}

.product-tags-panel {
  width: min(44rem, 100%);
}

.product-tags-modal-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin: 0.25rem 0 0.8rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand-soft) 34%, white);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.product-tags-modal-status strong {
  color: var(--ink);
}

.product-tags-modal-picker .product-category-options {
  max-height: min(42dvh, 24rem);
  overflow: auto;
}

.product-tags-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

.product-category-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
}

.product-category-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.2rem, 1fr));
  align-items: stretch;
  gap: 0.55rem;
  min-height: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9)),
    var(--soft);
}

.product-category-choice {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent));
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0.45rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 0.35rem 0.85rem rgba(15, 23, 42, 0.05);
  cursor: pointer;
}

.product-category-choice.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 0.45rem 1rem rgb(var(--accent-rgb) / 0.22);
}

.product-category-add {
  width: 2.7rem;
  min-width: 2.7rem;
  min-height: 2.7rem;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--accent));
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.product-category-add.is-active {
  background: var(--accent);
}

.product-category-empty {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.product-category-custom-input:not([hidden]) {
  margin-top: 0.45rem;
}

@media (max-width: 640px) {
  .product-code-badge {
    max-width: 46%;
    font-size: 0.72rem;
  }

  .inventory-summary-grid {
    grid-template-columns: repeat(5, minmax(8.35rem, 1fr));
    margin-inline: -0.15rem;
    padding-inline: 0.15rem;
  }

  .inventory-primary-actions,
  .inventory-add-primary {
    width: 100%;
  }

  .product-photo-first {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.7rem;
  }

  .product-variant-photo-field,
  .product-variant-chip {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-variant-chip .row-actions {
    justify-content: stretch;
  }

  .price-calculator-result {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-calculator-lot-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .price-calculator-lot-heading .ghost-button {
    width: 100%;
  }

  .price-calculator-line {
    grid-template-columns: minmax(0, 1fr) minmax(5rem, 0.45fr);
  }

  .price-calculator-line-photo,
  .price-calculator-line-name,
  .price-calculator-line-output {
    grid-column: 1 / -1;
  }

  .price-calculator-remove-line {
    justify-self: end;
  }

  .product-category-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-tags-open-button,
  .product-category-add {
    width: 100%;
  }

  .product-tags-modal-actions {
    justify-content: stretch;
  }

  .product-tags-modal-actions .primary-button {
    width: 100%;
  }
}

.wide {
  grid-column: 1 / -1;
}

.form-hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.field-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.option-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--accent-rgb) / 0.04);
}

.option-group .field-label {
  grid-column: 1 / -1;
}

.check-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-height: 2.25rem;
  color: var(--ink);
  font-size: 0.88rem;
}

.check-line input {
  width: 1.05rem;
  min-height: 1.05rem;
  padding: 0;
}

.consent-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
  font-size: 0.88rem;
  line-height: 1.4;
}

.consent-check input {
  width: 1.1rem;
  min-height: 1.1rem;
  margin-top: 0.1rem;
}

.consent-check a {
  color: var(--accent-strong);
}

.legal-page {
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 3rem);
}

.legal-document {
  width: min(54rem, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
}

.legal-document h1,
.legal-document h2 {
  margin-bottom: 0.5rem;
}

.legal-document p {
  color: var(--muted);
  line-height: 1.6;
}

.setup-callout {
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), var(--panel));
  padding: 0.85rem 1rem;
  color: var(--ink);
}

.setup-callout strong {
  font-size: 0.95rem;
}

.setup-callout span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.setup-callout.is-complete {
  border-color: rgba(24, 32, 31, 0.16);
  background: var(--soft);
}

.command-center {
  display: grid;
  gap: 0.9rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.06), var(--panel));
  padding: 1rem;
}

.command-center-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.command-center-heading h3 {
  margin: 0 0 0.2rem;
  color: var(--ink);
}

.command-center-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.command-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.command-toggle {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.78);
  padding: 0.75rem;
  color: var(--ink);
}

.command-toggle input {
  width: 1.15rem;
  min-height: 1.15rem;
  margin-top: 0.15rem;
  padding: 0;
  accent-color: var(--accent);
}

.command-toggle span {
  display: grid;
  gap: 0.2rem;
}

.command-toggle small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.28;
}

.advanced-settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--accent-rgb) / 0.035);
  padding: 0.75rem 0.9rem;
}

.advanced-settings summary {
  cursor: pointer;
  font-weight: 800;
}

.advanced-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.toolbar-inline .compact-select {
  width: auto;
  min-width: 11rem;
}

.portal-catalog-toolbar {
  align-items: end;
}

.portal-catalog-toolbar .search-input {
  width: min(19rem, 100%);
  max-width: none;
}

.portal-catalog-filter {
  min-width: min(13rem, 100%);
}

.primary-button,
.ghost-button,
.danger-button,
.chip-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 2.65rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0.6rem 0.85rem;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  font-weight: 800;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-button {
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.98), var(--accent-strong)),
    var(--accent);
  color: white;
  box-shadow: 0 12px 26px rgb(var(--accent-rgb) / 0.18);
}

.primary-button::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(110deg, transparent 0 34%, var(--shine) 48%, transparent 62% 100%);
  opacity: 0;
  transform: translateX(-120%);
}

.primary-button:hover {
  background:
    linear-gradient(135deg, var(--accent), var(--accent-strong)),
    var(--accent-strong);
  box-shadow: 0 16px 34px rgb(var(--accent-rgb) / 0.24);
}

.ghost-button,
.chip-button {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ghost-button:hover,
.chip-button:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(30, 42, 38, 0.08);
}

#client-access-form .access-forgot-password-link {
  justify-self: center;
  width: auto;
  min-height: 1.6rem;
  margin-top: -0.25rem;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 0.1rem 0.25rem;
  font-size: 0.82rem;
  font-weight: 800;
}

#client-access-form .access-forgot-password-link:hover,
#client-access-form .access-forgot-password-link:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.product-public-toggle.is-public {
  border-color: rgb(42 127 98 / 0.3);
  background: #effaf4;
  color: #236b50;
}

.product-public-toggle.is-private {
  border-color: rgba(184, 74, 59, 0.28);
  background: #fff6f2;
  color: var(--coral);
}

.product-preorder-toggle.is-on {
  border-color: rgb(var(--accent-rgb) / 0.32);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-strong);
}

.product-preorder-toggle.is-off {
  border-color: rgba(98, 88, 108, 0.22);
  background: #f8f6f9;
  color: var(--muted);
}

.danger-button {
  border-color: rgba(184, 74, 59, 0.35);
  background: #fff4f1;
  color: var(--coral);
}

.small {
  min-height: 2.15rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.search-input {
  max-width: 18rem;
}

.clients-directory-actions {
  display: grid;
  grid-template-columns: minmax(20rem, 1fr) minmax(6.8rem, 0.36fr) minmax(9.5rem, 0.46fr) max-content max-content;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.clients-directory-actions .search-input {
  width: 100%;
  max-width: none;
}

.clients-directory-heading {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.clients-directory-heading h2 {
  margin: 0;
  white-space: nowrap;
}

.client-directory-select {
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0 0.72rem;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 850;
}

.clients-directory-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 84%, var(--brand-primary));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
    var(--panel);
  box-shadow: 0 0.9rem 2.2rem rgba(16, 20, 22, 0.07);
}

.client-directory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  padding: 0.58rem 0.72rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.client-directory-row:last-child {
  border-bottom: 0;
}

.client-directory-row:hover,
.client-directory-row:focus-visible {
  z-index: 1;
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.11), rgba(255, 255, 255, 0.78));
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.22);
  outline: none;
}

.client-directory-row.is-deleted {
  background: color-mix(in srgb, var(--soft) 72%, white);
  color: color-mix(in srgb, var(--ink) 70%, var(--muted));
}

.client-directory-row.is-deleted:hover,
.client-directory-row.is-deleted:focus-visible {
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.13), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.client-directory-row.is-deleted .client-avatar-frame,
.client-directory-row.is-deleted .client-directory-finance {
  opacity: 0.74;
}

.client-directory-row.is-deleted .record-meta,
.client-directory-row.is-deleted .client-directory-notes {
  color: color-mix(in srgb, var(--muted) 84%, var(--ink));
}

.client-directory-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.client-directory-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.client-directory-copy .record-title,
.client-directory-copy .record-meta,
.client-directory-notes {
  min-width: 0;
}

.client-directory-copy .record-title strong,
.client-directory-copy .record-meta span,
.client-directory-notes span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-directory-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.client-directory-finance {
  min-width: 9.5rem;
  text-align: right;
}

.presence-button {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-height: 1.75rem;
  padding: 0.26rem 0.54rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.presence-button span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0.22rem color-mix(in srgb, currentColor 14%, transparent);
}

.presence-button.is-online {
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
  background: color-mix(in srgb, var(--success) 9%, white);
  color: color-mix(in srgb, var(--success) 86%, #102019);
}

.presence-button.is-offline {
  border-color: color-mix(in srgb, var(--line) 82%, var(--muted));
  background: color-mix(in srgb, var(--soft) 48%, white);
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
}

.presence-button:hover,
.presence-button:focus-visible {
  outline: none;
  border-color: rgb(var(--accent-rgb) / 0.36);
  box-shadow: 0 0.45rem 1.2rem rgba(20, 26, 28, 0.09);
}

.client-directory-actions-row {
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 28rem;
}

.client-directory-actions-row .small {
  min-height: 2rem;
  padding-inline: 0.55rem;
  font-size: 0.76rem;
}

.client-form-dialog {
  width: min(48rem, 100%);
}

.client-form-client-card {
  margin-bottom: 0.85rem;
}

.client-form-summary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), transparent 70%),
    rgba(255, 255, 255, 0.8);
  padding: 0.78rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.client-form-summary-card.is-new {
  grid-template-columns: minmax(0, 1fr);
}

.client-form-summary-card .client-avatar-frame {
  width: 3.6rem;
  height: 3.6rem;
}

.client-form-summary-copy,
.client-form-summary-money {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.client-form-summary-money {
  justify-items: end;
  text-align: right;
}

.client-form-summary-money strong {
  color: var(--ink);
}

.client-form-summary-money span,
.client-form-summary-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.client-form-summary-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.client-directory-row .client-avatar {
  width: 3.05rem;
}

.client-directory-row .client-avatar-frame::before {
  inset: -0.22rem;
}

.client-directory-row .client-plan-ribbon {
  max-width: 4.5rem;
  bottom: -0.36rem;
  padding: 0.1rem 0.36rem;
  font-size: 0.52rem;
}

.interac-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgb(var(--accent-rgb) / 0.28);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 0.85rem;
}

.interac-card.is-compact {
  margin-top: 0.75rem;
}

.payment-note {
  max-width: 38rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.invoice-workspace {
  grid-template-columns: minmax(19rem, 22rem) minmax(0, 1fr);
  gap: 1.15rem;
}

.payment-panel {
  align-self: start;
  display: grid;
  gap: 0.85rem;
}

.payment-panel .panel-heading,
.invoice-list-heading {
  align-items: flex-start;
  margin-bottom: 0.3rem;
}

.payment-panel .panel-heading h2,
.invoice-list-heading h2 {
  margin: 0;
}

.invoice-list-heading p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.payment-panel #payment-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.payment-panel #payment-form .wide,
.payment-panel #payment-form .primary-button {
  grid-column: 1 / -1;
}

.payment-panel #payment-form .primary-button {
  min-height: 2.55rem;
}

.payment-panel > div.form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 0.75fr);
  gap: 0.52rem;
}

.invoice-list-panel {
  overflow: hidden;
}

.invoice-tools {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(8.5rem, 0.45fr) minmax(9.25rem, 0.5fr) auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-bottom: 0.78rem;
}

.invoice-tools .search-input,
.invoice-tools select {
  min-width: 0;
  min-height: 2.35rem;
}

.invoice-tools button {
  min-height: 2.35rem;
  white-space: nowrap;
}

.invoice-action-panel {
  display: grid;
  gap: 0.72rem;
  margin-bottom: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  border-radius: 0.78rem;
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.07), transparent 19rem),
    color-mix(in srgb, var(--soft) 64%, white);
  padding: 0.82rem;
}

.compact-heading {
  margin-bottom: 0;
}

.invoice-batch-grid {
  grid-template-columns: minmax(14.5rem, 0.38fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0.65rem;
}

.invoice-action-panel .compact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.invoice-action-panel .compact-heading h3,
.invoice-action-copy h3 {
  margin: 0;
  font-size: 0.98rem;
}

.invoice-action-copy {
  display: grid;
  gap: 0.35rem;
}

.invoice-schedule-field input {
  min-height: 2.35rem;
}

.batch-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  align-content: stretch;
  justify-content: stretch;
  width: 100%;
}

.batch-actions button {
  width: 100%;
  min-width: 0;
  min-height: 2.28rem;
  padding: 0.44rem 0.58rem;
  font-size: 0.76rem;
  line-height: 1.15;
}

.invoice-batch-grid > .batch-actions {
  grid-column: 2 / -1;
}

.payment-history-list {
  gap: 0.55rem;
  max-height: 31rem;
  overflow: auto;
  padding-right: 0.12rem;
}

.payment-record {
  gap: 0.45rem;
  padding: 0.72rem;
}

.payment-record-main,
.invoice-card-main {
  display: grid;
  gap: 0.75rem;
  align-items: center;
}

.payment-record-main {
  grid-template-columns: minmax(0, 1fr) auto;
}

.payment-record-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.payment-record-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.payment-record-side {
  display: grid;
  gap: 0.25rem;
  justify-items: end;
}

.payment-record-side strong {
  font-size: 1.05rem;
}

.payment-record-actions {
  justify-content: flex-end;
}

.invoice-card {
  gap: 0.45rem;
  padding: 0.72rem 0.82rem;
  border-radius: 0.72rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 255, 255, 0.94)),
    white;
}

.invoice-card-main {
  grid-template-columns: minmax(0, 1fr) minmax(7.2rem, auto);
  gap: 0.85rem;
}

.invoice-card-title {
  gap: 0.36rem;
  align-items: center;
}

.invoice-card-title > strong {
  font-size: 0.98rem;
}

.invoice-card-meta {
  gap: 0.3rem 0.62rem;
  margin-top: 0.12rem;
  font-size: 0.84rem;
}

.invoice-card .invoice-select-row {
  align-items: center;
  color: color-mix(in srgb, var(--ink) 74%, var(--muted));
  font-weight: 900;
}

.invoice-card .invoice-select-row strong {
  font-size: 0.98rem;
}

.invoice-payment-actions {
  gap: 0.35rem;
  min-width: 7rem;
}

.invoice-payment-actions > span:first-child {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.invoice-payment-actions > strong {
  font-size: 1.05rem;
}

.invoice-payment-actions > strong.is-due {
  color: var(--ink);
}

.invoice-card-actions {
  justify-content: flex-end;
  gap: 0.45rem;
}

.invoice-card-actions button {
  white-space: nowrap;
}

.data-grid,
.stack-list,
.draft-list {
  display: grid;
  gap: 0.65rem;
}

.record {
  position: relative;
  display: grid;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9)),
    white;
  padding: 0.85rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  content-visibility: auto;
  contain-intrinsic-size: 8rem;
}

.record.is-selected {
  border-color: rgb(var(--accent-rgb) / 0.48);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.12);
}

.branding-editor {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0.85rem;
}

.branding-preview {
  display: grid;
  place-items: center;
  min-height: 6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 0.65rem;
}

.branding-preview img {
  width: min(100%, 10rem);
  max-height: 5rem;
  object-fit: contain;
}

.branding-fields {
  display: grid;
  gap: 0.65rem;
}

.brand-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.brand-swatch {
  width: 2.35rem;
  height: 2.35rem;
  border: 2px solid white;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line);
}

.brand-swatch.is-active {
  box-shadow: 0 0 0 2px var(--ink);
}

body[data-theme="dark"] .access-card,
body[data-theme="dark"] .access-panel,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .record,
body[data-theme="dark"] .branding-editor,
body[data-theme="dark"] .legal-document {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--panel);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .chip-button,
body[data-theme="dark"] .icon-button {
  border-color: var(--line);
  background: #101416;
  color: var(--ink);
}

body[data-theme="dark"] .invoice-action-panel,
body[data-theme="dark"] .setup-callout,
body[data-theme="dark"] .command-center,
body[data-theme="dark"] .interac-card,
body[data-theme="dark"] .cart-delivery-panel,
body[data-theme="dark"] .branding-preview,
body[data-theme="dark"] .client-notification.is-unread {
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.14), rgba(255, 255, 255, 0.02)),
    var(--panel);
}

body[data-theme="dark"] .command-toggle {
  background: #101416;
}

body[data-theme="dark"] .cart-delivery-option {
  background: #101416;
}

body[data-theme="dark"] .status-pill {
  border-color: rgb(var(--accent-rgb) / 0.3);
  background: rgb(var(--accent-rgb) / 0.16);
}

body[data-theme="contrast"] .panel,
body[data-theme="contrast"] .metric,
body[data-theme="contrast"] .record {
  border-color: rgba(14, 18, 18, 0.16);
}

#business-data-panel,
body[data-space="client"] #business-settings-panel,
body[data-space="client"] #drop-points-panel,
body:not([data-space="client"]) #client-settings-panel {
  display: none;
}

.status-hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.portal-profile {
  display: grid;
}

.portal-profile-card {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem;
}

.portal-profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.portal-profile-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.portal-profile-card .record-main {
  align-items: center;
  justify-content: flex-start;
}

.portal-profile-main-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.portal-profile-main-button:hover .client-avatar,
.portal-profile-main-button:focus-visible .client-avatar {
  transform: translateY(-1px);
}

.portal-profile-main-button:focus-visible {
  outline: 3px solid rgb(var(--accent-rgb) / 0.25);
  outline-offset: 3px;
}

.portal-profile-message-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--brand-soft) 56%, #fff));
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 1.05rem;
  box-shadow: 0 0.45rem 1rem rgba(26, 20, 36, 0.1);
}

.portal-profile-message-button .nav-badge {
  top: -0.34rem;
  right: -0.36rem;
}

.portal-profile-copy {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.portal-profile-copy > strong {
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  line-height: 1.1;
}

.portal-profile-vip {
  display: grid;
  gap: 0.28rem;
  max-width: min(100%, 28rem);
  padding-top: 0;
}

.portal-profile-vip-head {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.75rem;
  font-weight: 850;
  gap: 0.65rem;
  justify-content: space-between;
  line-height: 1.2;
}

.portal-profile-vip-head strong {
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.portal-profile-vip .portal-vip-progress-row {
  gap: 0.55rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.portal-profile-vip .portal-vip-progress-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.portal-profile-vip .portal-vip-progress-row strong {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

.portal-profile-vip > small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
}

.portal-profile-kicker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.portal-profile-kicker span:not(.tag) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-profile-card p {
  margin-bottom: 0;
}

body[data-space="client"] #portal > .split-layout,
body[data-space="client"] #portal > .client-secondary-panel {
  display: none;
}

.client-home-actions-panel {
  display: grid;
  gap: 0.75rem;
}

.client-home-actions {
  display: grid;
  grid-template-columns: minmax(10rem, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.client-home-actions button {
  min-height: 3.1rem;
}

.client-notifications-list {
  display: grid;
  gap: 0.75rem;
}

.client-notifications-list:empty {
  display: none;
}

.portal-notification-ticker {
  align-items: center;
  background: color-mix(in srgb, var(--panel) 92%, var(--brand-soft));
  border: 1px solid rgb(var(--accent-rgb) / 0.18);
  border-radius: calc(var(--radius) - 0.35rem);
  box-shadow: 0 0.5rem 1.25rem rgba(35, 28, 44, 0.06);
  display: grid;
  gap: 0.6rem;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 3.15rem;
  overflow: hidden;
  padding: 0.45rem 0.65rem;
}

.portal-notification-ticker[hidden] {
  display: none !important;
}

.portal-notification-ticker-label,
.portal-notification-ticker-item {
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  min-width: 0;
}

.portal-notification-ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--brand-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 950;
  padding: 0.42rem 0.65rem;
}

.portal-notification-ticker-label strong {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--panel);
  font-size: 0.72rem;
}

.portal-notification-ticker-item {
  align-items: center;
  background: transparent;
  display: grid;
  gap: 0.08rem;
  padding: 0;
  text-align: left;
  width: 100%;
}

.portal-notification-ticker-item strong,
.portal-notification-ticker-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-notification-ticker-item strong {
  font-size: 0.9rem;
}

.portal-notification-ticker-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-notification-ticker-item.is-unread strong::after {
  content: "";
}

.portal-notification-ticker-item.is-unread strong::after {
  color: var(--accent-strong);
  content: " •";
}

.portal-notification-ticker-item.is-unread strong::after {
  content: "" !important;
}

@keyframes notificationTicker {
  0%, 7% {
    opacity: 0;
    transform: translateY(0.45rem);
  }
  12%, 29% {
    opacity: 1;
    transform: translateY(0);
  }
  34%, 100% {
    opacity: 0;
    transform: translateY(-0.45rem);
  }
}

.client-notifications-header,
.client-notification {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.client-notification-stack {
  display: grid;
  gap: 0.6rem;
}

.client-notification {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.85rem;
}

.client-notification.is-unread {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--line));
  background: var(--brand-soft);
}

.client-notification p {
  margin: 0.25rem 0;
}

.client-notification-target {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.client-notification-target strong,
.client-notification-target p {
  overflow-wrap: anywhere;
}

.client-messages-page-panel {
  max-width: 64rem;
  margin-inline: auto;
}

.client-messages-page-list {
  display: grid;
  gap: 0.8rem;
}

.client-message-thread {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--panel) 84%, var(--brand-soft)));
  padding: 0.9rem;
  box-shadow: 0 0.55rem 1.35rem rgba(25, 20, 34, 0.06);
}

.client-message-thread.is-unread {
  border-color: color-mix(in srgb, var(--brand-primary) 42%, var(--line));
  box-shadow:
    0 0.7rem 1.6rem rgba(39, 22, 54, 0.08),
    0 0 0 1px rgb(var(--accent-rgb) / 0.14) inset;
}

.client-message-thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.client-message-bubbles {
  display: grid;
  gap: 0.45rem;
}

.client-message-bubble {
  display: grid;
  gap: 0.25rem;
  width: min(88%, 34rem);
  border: 1px solid rgba(16, 20, 22, 0.08);
  border-radius: 0.78rem;
  padding: 0.62rem 0.72rem;
}

.client-message-bubble.is-business {
  justify-self: start;
  background: rgba(255, 255, 255, 0.92);
}

.client-message-bubble.is-client {
  justify-self: end;
  background: color-mix(in srgb, var(--brand-soft) 72%, #fff);
}

.client-message-bubble-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.client-message-bubble-head strong {
  color: var(--text);
}

.client-message-bubble p,
.client-message-legacy-body p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.client-message-legacy-section {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.4rem;
}

.client-message-legacy-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.client-message-legacy-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
}

@media (max-width: 620px) {
  .client-message-thread-head {
    align-items: stretch;
    flex-direction: column;
  }

  .client-message-bubble {
    width: 100%;
  }
}

.client-progress-panel,
.client-home-invoices-panel {
  scroll-margin-top: 1rem;
}

.client-progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 0.85rem;
}

.client-progress-grid .record {
  height: 100%;
}

.membership-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.membership-plan-card {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  padding: 0.9rem;
  box-shadow: 0 0.65rem 1.5rem rgba(35, 28, 44, 0.06);
}

.membership-plan-card.is-active {
  border-color: rgb(var(--accent-rgb) / 0.42);
  box-shadow: var(--shadow);
}

.membership-plan-card-head {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  justify-content: space-between;
}

.membership-plan-card-head div {
  display: grid;
  gap: 0.15rem;
}

.membership-plan-card-head strong {
  font-size: 1rem;
}

.membership-plan-card-head span:not(.tag),
.membership-plan-card p,
.membership-plan-details {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.membership-plan-card p {
  margin: 0;
}

.membership-plan-highlights,
.membership-plan-details ul {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-left: 1.1rem;
}

.membership-plan-highlights {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.membership-plan-details {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.membership-plan-details[hidden] {
  display: none;
}

.vip-guide-card {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.85rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), rgba(255, 255, 255, 0.92)),
    var(--panel);
  padding: 0.95rem;
  box-shadow: 0 0.8rem 1.8rem rgba(35, 28, 44, 0.07);
}

.vip-guide-card h3,
.vip-guide-card p {
  margin: 0;
}

.vip-guide-card h3 {
  margin-top: 0.35rem;
  font-size: 1.18rem;
}

.vip-guide-card p,
.vip-guide-card small {
  color: var(--muted);
  line-height: 1.45;
}

.vip-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.vip-guide-grid > div {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.72);
  padding: 0.75rem;
}

.vip-guide-grid strong,
.vip-guide-grid span,
.vip-guide-grid small {
  overflow-wrap: anywhere;
}

.vip-guide-grid strong {
  font-size: 0.84rem;
}

.vip-guide-grid span {
  font-weight: 900;
}

.client-invoice-detail {
  margin-top: 0.85rem;
}

.client-invoice-detail:empty {
  display: none;
}

.client-invoice-card {
  cursor: pointer;
}

.client-invoice-summary-button {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.client-invoice-summary-button .chip-button {
  pointer-events: none;
}

.client-invoice-card:hover,
.client-invoice-card:focus-visible,
.client-invoice-card:focus-within {
  border-color: rgb(var(--accent-rgb) / 0.42);
  box-shadow: var(--shadow);
  outline: none;
}

.client-avatar-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: max-content;
  isolation: isolate;
}

.client-avatar-frame::before {
  position: absolute;
  inset: -0.34rem;
  z-index: -1;
  display: none;
  border-radius: 50%;
  content: "";
  background: var(--line);
  opacity: 0.75;
}

.client-avatar-frame[data-plan="vip"]::before {
  display: block;
  background: conic-gradient(from 150deg, var(--accent), #2d0b35, #f2c94c, var(--accent));
  box-shadow: 0 0 0.85rem rgb(var(--accent-rgb) / 0.26);
}

.client-avatar-frame[data-plan="vendeur"]::before {
  display: block;
  background: conic-gradient(from 150deg, #8f98a8, #f8fafc, #cbd5e1, #64748b, #f8fafc, #8f98a8);
  box-shadow: 0 0 0.85rem rgba(100, 116, 139, 0.24);
}

.client-avatar-frame[data-plan="vendeur_pro"]::before {
  display: block;
  background: conic-gradient(from 150deg, #050505, #b58b2a, #fff0b3, #050505);
  box-shadow: 0 0 1rem rgba(181, 139, 42, 0.28);
}

.client-avatar,
.profile-photo-preview {
  width: 5.25rem;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
}

.client-avatar,
.profile-photo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  object-fit: cover;
}

.client-avatar img,
.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-plan-ribbon {
  position: absolute;
  right: 50%;
  bottom: -0.55rem;
  transform: translateX(50%);
  max-width: 6.75rem;
  border: 1px solid rgba(24, 22, 28, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #15131a;
  padding: 0.16rem 0.52rem;
  box-shadow: 0 0.45rem 1rem rgba(24, 22, 28, 0.12);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-shadow: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.client-avatar-frame[data-plan="vip"] .client-plan-ribbon {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.client-avatar-frame[data-plan="vendeur"] .client-plan-ribbon {
  border-color: rgba(100, 116, 139, 0.34);
  background: #f8fafc;
  color: #334155;
}

.client-avatar-frame[data-plan="vendeur_pro"] .client-plan-ribbon {
  border-color: rgba(181, 139, 42, 0.48);
  background: #050505;
  color: #ffe49a;
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
}

.client-profile-points-card {
  margin-top: 1rem;
}

.client-profile-points-card[hidden] {
  display: none;
}

.client-profile-points-panel {
  display: grid;
  gap: 0.75rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), rgba(255, 255, 255, 0.86)),
    var(--panel);
  padding: 0.95rem;
}

.client-profile-points-panel .panel-heading {
  margin-bottom: 0;
}

.profile-photo-card {
  position: relative;
  display: grid;
  gap: 0.65rem;
  min-width: 10rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.16);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 28% 18%, rgb(var(--accent-rgb) / 0.12), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgb(var(--accent-rgb) / 0.045));
  padding: 0.9rem;
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.06);
}

.profile-photo-title {
  font-size: 0.86rem;
  font-weight: 950;
}

.profile-photo-editor .profile-photo-preview {
  width: auto;
  min-width: 7.5rem;
  min-height: 8.5rem;
  aspect-ratio: auto;
  border: 0;
  border-radius: var(--radius);
  overflow: visible;
  background: transparent;
  padding: 0.7rem;
}

.profile-photo-remove {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  border: 1px solid rgba(184, 74, 59, 0.28);
  border-radius: 999px;
  background: rgba(255, 240, 236, 0.95);
  color: var(--coral);
  padding: 0.28rem 0.52rem;
  box-shadow: 0 0.45rem 1rem rgba(24, 22, 28, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
}

.profile-photo-editor .profile-photo-preview .client-avatar-frame {
  transform: scale(1.05);
}

.profile-upload-fields {
  display: grid;
  gap: 0.7rem;
  align-content: center;
}

.profile-upload-fields .form-hint {
  margin: 0.2rem 0 0;
}

.profile-upload-button {
  display: inline-flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(var(--accent-rgb) / 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  padding: 0.65rem 1rem;
  box-shadow: 0 0.7rem 1.5rem rgb(var(--accent-rgb) / 0.18);
  font-weight: 950;
}

.profile-upload-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.profile-referral-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), transparent 46%),
    var(--panel);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.profile-referral-card h3 {
  margin: 0.4rem 0 0.2rem;
}

.profile-referral-card p {
  margin: 0 0 0.55rem;
  color: var(--muted);
}

.profile-referral-card code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.08);
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
}

.portal-catalog-actions {
  align-items: end;
  justify-content: flex-start;
}

.product-photo-editor {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
}

.receipt-photo-editor {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
}

.receipt-photo-preview,
.receipt-thumb {
  width: 7rem;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.receipt-photo-preview,
.receipt-thumb.is-empty {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.receipt-photo-preview img,
.receipt-thumb {
  display: block;
  object-fit: cover;
}

.receipt-photo-preview img,
.receipt-thumb {
  width: 100%;
  height: 100%;
}

.expense-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.65rem;
  font-size: 0.82rem;
}

.expense-data-table th,
.expense-data-table td {
  border-top: 1px solid var(--line);
  padding: 0.42rem 0.35rem;
  text-align: left;
}

.product-photo-preview,
.product-thumb {
  width: 5.25rem;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.product-photo-button {
  position: relative;
  display: inline-grid;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: inherit;
}

.product-media-count {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  border-radius: 999px;
  background: rgba(10, 14, 13, 0.78);
  color: #fff;
  padding: 0.18rem 0.42rem;
  font-size: 0.68rem;
  font-weight: 800;
}

.product-media-video {
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.9);
  color: #fff;
  padding: 0.18rem 0.42rem;
  font-size: 0.68rem;
  font-weight: 900;
}

.product-photo-button:focus-visible {
  outline: 3px solid rgb(var(--accent-rgb) / 0.35);
  outline-offset: 3px;
}

.product-photo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
}

.product-photo-preview img,
.product-thumb {
  display: block;
  object-fit: cover;
}

.product-photo-preview img {
  width: 100%;
  height: 100%;
}

.product-photo-editor .product-photo-preview {
  width: 100%;
  min-height: 5.25rem;
  aspect-ratio: auto;
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
  align-items: stretch;
  justify-items: stretch;
  padding: 0.35rem;
  gap: 0.35rem;
}

.product-photo-editor .product-photo-preview img {
  aspect-ratio: 1;
  border-radius: calc(var(--radius) - 0.25rem);
  object-fit: cover;
}

.product-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.product-record-main {
  display: grid;
  align-items: start;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.catalog-deck {
  margin-bottom: 1rem;
}

.catalog-swipe-card {
  display: grid;
  grid-template-columns: minmax(10rem, 42%) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  border: 1px solid rgb(var(--accent-rgb) / 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.12), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: pan-y;
  transform: translate3d(var(--catalog-swipe-x, 0), 0, 0) rotate(var(--catalog-swipe-rotate, 0deg));
  opacity: var(--catalog-swipe-opacity, 1);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease, box-shadow 180ms ease;
  user-select: none;
  will-change: transform, opacity;
}

.catalog-swipe-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.catalog-swipe-card.is-swipe-resetting {
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease;
}

.catalog-swipe-card.is-swipe-exiting-left {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-112%, 0, 0) rotate(-4deg) scale(0.985);
  transition: transform 210ms cubic-bezier(0.42, 0, 1, 1), opacity 180ms ease;
}

.catalog-swipe-card.is-swipe-exiting-right {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(112%, 0, 0) rotate(4deg) scale(0.985);
  transition: transform 210ms cubic-bezier(0.42, 0, 1, 1), opacity 180ms ease;
}

.catalog-deck.is-entering-next .catalog-swipe-card {
  animation: catalog-card-enter-next 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.catalog-deck.is-entering-previous .catalog-swipe-card {
  animation: catalog-card-enter-previous 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.catalog-deck-photo,
.catalog-deck-photo .product-photo-button {
  min-height: 18rem;
}

.catalog-deck-thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 18rem;
  object-fit: cover;
  background: var(--soft);
}

.catalog-deck-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.catalog-deck-body {
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.catalog-deck-body h3 {
  margin: 0.6rem 0 0.35rem;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
}

.catalog-deck-body p {
  margin: 0;
  color: var(--muted);
}

.catalog-deck-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.catalog-deck-actions button {
  min-height: 3.25rem;
}

@keyframes catalog-card-enter-next {
  from {
    opacity: 0;
    transform: translate3d(16%, 0, 0) rotate(1.8deg) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@keyframes catalog-card-enter-previous {
  from {
    opacity: 0;
    transform: translate3d(-16%, 0, 0) rotate(-1.8deg) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

.catalog-photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.catalog-photo-card {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 0.65rem;
  align-items: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0.65rem;
  box-shadow: 0 0.65rem 1.5rem rgba(35, 28, 44, 0.06);
}

.catalog-photo-card.is-out-of-stock,
.catalog-swipe-card.is-out-of-stock,
.public-product-card.is-out-of-stock {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 243, 248, 0.82)),
    white;
}

.catalog-photo-card.is-out-of-stock .catalog-photo-thumb,
.catalog-swipe-card.is-out-of-stock img,
.public-product-card.is-out-of-stock img {
  filter: grayscale(0.38);
  opacity: 0.72;
}

.catalog-photo-card .catalog-photo-open {
  grid-row: 1 / span 4;
}

.catalog-photo-open,
.cart-line-photo {
  position: relative;
  display: grid;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}

.catalog-photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--soft);
}

.catalog-photo-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.catalog-photo-caption {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.catalog-photo-caption strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-photo-caption span {
  font-weight: 900;
}

.product-price-stack {
  display: inline-grid;
  gap: 0.08rem;
  line-height: 1.1;
}

.product-sale-price {
  color: var(--ink);
  font-weight: 950;
}

.product-original-price {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 800;
  text-decoration: line-through;
}

.product-discount-badge {
  color: var(--brand-primary);
}

.catalog-photo-caption small {
  color: var(--muted);
  font-weight: 800;
}

.catalog-photo-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 0.45rem;
}

.catalog-variant-field,
.catalog-quantity-field {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.catalog-variant-field select,
.catalog-quantity-field input {
  width: 100%;
  min-width: 0;
}

.quantity-stepper {
  align-items: center;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
}

.quantity-stepper-button {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.35rem);
  color: var(--ink);
  display: grid;
  font-size: 1.05rem;
  font-weight: 950;
  min-height: 2.35rem;
  padding: 0;
  place-items: center;
}

.quantity-stepper-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.quantity-stepper input,
.catalog-quantity-field input {
  text-align: center;
}

.catalog-photo-actions button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.auction-record .product-thumb {
  width: 5rem;
  aspect-ratio: 1;
}

.auction-card {
  align-content: start;
}

.auction-client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.auction-actions {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
}

.cart-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.cart-line-photo,
.cart-line-thumb {
  width: 5.5rem;
  aspect-ratio: 1;
}

.cart-line-thumb {
  display: block;
  object-fit: cover;
  background: var(--soft);
}

.cart-line-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.cart-line-body {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.cart-line-body strong {
  overflow-wrap: anywhere;
}

.cart-line-body small {
  color: var(--muted);
  font-weight: 800;
}

.cart-line-actions {
  grid-column: 1 / -1;
  align-items: center;
}

.cart-empty-state {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
}

.cart-delivery-panel {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), rgba(255, 255, 255, 0.92)),
    var(--panel);
  padding: 0.75rem;
}

.client-invoice-delivery-card {
  margin: 0.85rem 0;
  border-color: rgb(var(--accent-rgb) / 0.22);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.08), rgba(255, 255, 255, 0.96)),
    var(--panel);
}

.cart-delivery-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.cart-delivery-heading strong {
  font-size: 0.96rem;
}

.cart-delivery-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.cart-delivery-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.cart-delivery-option {
  display: grid;
  gap: 0.15rem;
  min-height: 3.35rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  text-align: left;
  cursor: pointer;
}

.cart-delivery-option strong,
.cart-delivery-option span {
  overflow-wrap: anywhere;
}

.cart-delivery-option span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.cart-delivery-option.is-active {
  border-color: rgb(var(--accent-rgb) / 0.6);
  background: rgb(var(--accent-rgb) / 0.14);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.1);
}

.cart-delivery-option:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.client-invoice-drop-point-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.55rem;
}

.client-invoice-drop-point-picker .form-hint {
  grid-column: 1 / -1;
}

.cart-command-actions {
  position: sticky;
  top: calc(0.75rem + env(safe-area-inset-top));
  z-index: 8;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  padding: 0.65rem;
  box-shadow: 0 10px 24px rgba(30, 42, 38, 0.08);
  backdrop-filter: blur(10px);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1260;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.image-lightbox[hidden] {
  display: none !important;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 14, 13, 0.72);
}

.image-lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.85rem;
  width: min(44rem, 100%);
  max-height: min(92vh, 56rem);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.85rem;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
  touch-action: pan-x;
  cursor: grab;
  transform: translateY(var(--lightbox-swipe-y, 0)) scale(var(--lightbox-swipe-scale, 1));
  opacity: var(--lightbox-swipe-opacity, 1);
  transition:
    transform 360ms cubic-bezier(0.18, 0.9, 0.22, 1),
    opacity 280ms ease,
    box-shadow 300ms ease;
  will-change: transform;
}

.image-lightbox-panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgb(var(--accent-rgb) / calc(var(--lightbox-swipe-glow, 0) * 0.22)), transparent 42%),
    linear-gradient(300deg, rgb(34 211 238 / calc(var(--lightbox-swipe-glow, 0) * 0.16)), transparent 48%);
  filter: blur(0.5px);
  opacity: var(--lightbox-swipe-glow, 0);
  transition: opacity 160ms ease;
  pointer-events: none;
}

.image-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(58vh, 34rem);
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--soft);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-x;
  user-select: none;
}

.image-lightbox-stage.is-swiping {
  cursor: grabbing;
}

.image-lightbox-panel.is-swiping {
  cursor: grabbing;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.34),
    0 0 34px rgb(var(--accent-rgb) / calc(var(--lightbox-swipe-glow, 0) * 0.28));
  transition: none;
}

.image-lightbox-panel.is-swipe-committing {
  pointer-events: none;
  transition:
    transform 330ms cubic-bezier(0.12, 0.82, 0.18, 1),
    opacity 280ms ease,
    box-shadow 280ms ease;
}

.image-lightbox-panel.is-swipe-entering {
  pointer-events: none;
  transition:
    transform 390ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 320ms ease,
    box-shadow 320ms ease;
}

.image-lightbox-panel.is-swipe-resetting {
  transition: none !important;
}

.image-lightbox-panel img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--soft);
}

.image-lightbox-stage > img {
  background: transparent;
  pointer-events: none;
  transition: transform 160ms ease;
  will-change: transform;
}

.image-lightbox-stage.is-swiping > img {
  transition: none;
}

.image-lightbox-nav {
  display: none !important;
}

.image-lightbox-gallery {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
}

.image-lightbox-thumb {
  width: 4rem;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 2px solid transparent;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--soft);
  padding: 0;
  overflow: hidden;
}

.image-lightbox-thumb.is-active {
  border-color: var(--accent);
}

.image-lightbox-thumb img {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
}

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

.product-video {
  width: 100%;
  max-height: 16rem;
  border-radius: calc(var(--radius) - 0.25rem);
  background: #000;
}

.product-video-link {
  width: fit-content;
}

.image-lightbox-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.image-lightbox-panel h2,
.image-lightbox-panel p {
  margin: 0;
}

#product-photo-lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--muted);
}

#product-photo-lightbox-meta span:last-child {
  flex-basis: 100%;
  color: var(--ink);
}

.image-lightbox-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 10rem) auto;
  align-items: end;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.image-lightbox-actions:empty {
  display: none;
}

.lightbox-quantity-field input {
  text-align: center;
}

.client-finance-summary {
  display: grid;
  gap: 0.2rem;
  justify-items: end;
  color: var(--muted);
  font-size: 0.84rem;
}

.quantity-field {
  width: min(5.5rem, 100%);
}

.quantity-field input {
  min-height: 2.15rem;
}

.record-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.record-side-actions {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
}

.client-invoice-payment-panel {
  border-color: rgb(var(--accent-rgb) / 0.34);
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.09), var(--panel));
}

.record-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.record-title strong {
  font-size: 1rem;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.line-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
}

.progress-track {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.prep-lines {
  display: grid;
  gap: 0.5rem;
}

.prep-line {
  display: grid;
  grid-template-columns: 1.2rem 1fr auto;
  align-items: center;
  gap: 0.65rem;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}

.prep-line input {
  width: 1.1rem;
  min-height: 1.1rem;
  accent-color: var(--accent);
}

.prep-line.is-done span {
  color: var(--muted);
  text-decoration: line-through;
}

.prep-sheet {
  display: grid;
  gap: 0.85rem;
}

.prep-sheet-header {
  display: grid;
  gap: 0.35rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
}

.prep-sheet-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prep-sheet-list li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.invoice-detail-panel {
  margin-top: 1rem;
}

.invoice-detail {
  overflow-x: auto;
}

.business-order-record {
  gap: 0.75rem;
}

.business-order-record .record-main {
  align-items: center;
}

.business-order-record .record-title strong {
  font-size: 1.05rem;
}

.business-order-amount {
  align-items: flex-end;
  gap: 0.1rem;
  min-width: 7rem;
}

.business-order-amount span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.business-invoice-panel {
  width: min(58rem, 100%);
}

.business-invoice-actions {
  justify-content: flex-end;
  margin-bottom: 0.85rem;
}

.business-prep-panel {
  width: min(58rem, 100%);
}

.business-prep-actions {
  justify-content: flex-end;
  margin-bottom: 0.85rem;
}

.business-prep-detail {
  display: grid;
  gap: 1rem;
  overflow-x: auto;
}

.prep-modal-lines {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--soft) 42%, white);
  padding: 0.8rem;
}

.batch-print-stage {
  display: none;
}

.batch-print-page {
  page-break-after: always;
  break-after: page;
}

.batch-print-page:last-child {
  page-break-after: auto;
  break-after: auto;
}

.business-invoice-detail {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 0.8);
  background: rgba(255, 255, 255, 0.64);
  padding: 1rem;
}

.invoice-paper {
  display: grid;
  gap: 1rem;
  min-width: 34rem;
}

.invoice-header,
.invoice-client {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.invoice-header strong,
.invoice-header span,
.invoice-client strong,
.invoice-client span {
  display: block;
}

.invoice-header > div:last-child {
  text-align: right;
}

.invoice-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.invoice-brand img {
  width: 5rem;
  height: auto;
  object-fit: contain;
}

.invoice-client {
  display: grid;
  justify-content: stretch;
}

.invoice-client > span,
.invoice-header span,
.invoice-draft,
.invoice-terms p,
.invoice-payments p {
  color: var(--muted);
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.invoice-table th:nth-child(n+2),
.invoice-table td:nth-child(n+2) {
  text-align: right;
}

.invoice-totals {
  display: grid;
  gap: 0.4rem;
  justify-self: end;
  min-width: min(18rem, 100%);
  margin: 0;
}

.invoice-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.invoice-totals dt,
.invoice-totals dd {
  margin: 0;
}

.invoice-totals .balance {
  border-top: 2px solid var(--ink);
  font-weight: 800;
  padding-top: 0.45rem;
}

.invoice-terms {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.invoice-terms p {
  margin: 0.35rem 0 0;
}

.invoice-payments {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.invoice-payments p {
  margin: 0.35rem 0 0;
}

.invoice-payment-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.invoice-payment-list li {
  display: grid;
  grid-template-columns: minmax(5rem, 0.8fr) minmax(6rem, 1fr) minmax(0, 1.4fr) auto auto;
  gap: 0.6rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 0;
}

.invoice-payment-list span {
  color: var(--muted);
}

.invoice-draft textarea {
  margin-top: 0.35rem;
  color: var(--ink);
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  padding: 0.18rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 800;
}

.tag.warn,
.status-pill.warn {
  background: #fff4d8;
  color: var(--amber);
}

.tag.danger {
  background: #fff0ec;
  color: var(--coral);
}

.tag.violet,
.status-pill.violet {
  background: #f0efff;
  color: var(--violet);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 1.25rem;
  text-align: center;
}

.app-tour {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-tour[hidden] {
  display: none !important;
}

.app-tour-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(16, 20, 22, 0.34);
}

.app-tour-card {
  position: relative;
  width: min(34rem, 100%);
  border: 1px solid rgb(var(--accent-rgb) / 0.28);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-strong);
  padding: 1.15rem;
}

.app-tour-step {
  display: inline-flex;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  padding: 0.25rem 0.65rem;
  font-weight: 800;
  font-size: 0.8rem;
}

.app-tour-card h2 {
  margin: 0.75rem 0 0.45rem;
}

.app-tour-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.app-tour-dots {
  display: flex;
  gap: 0.35rem;
  margin-top: 1rem;
}

.app-tour-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--line);
}

.app-tour-dot.is-active {
  width: 1.4rem;
  background: var(--accent);
}

.app-tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.15rem;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .public-home {
    grid-template-columns: 1fr;
  }

  .public-product-strip {
    grid-template-columns: 1fr 1fr;
  }

  .client-featured-products .public-product-card {
    flex-basis: 78%;
    min-width: 78%;
  }

  .featured-carousel-shell::before,
  .featured-carousel-shell::after {
    width: 1.8rem;
  }

  .featured-scroll-button {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 1.25rem;
  }

  .featured-scroll-button.prev {
    left: 0.2rem;
  }

  .featured-scroll-button.next {
    right: 0.2rem;
  }

  .public-home-actions > button,
  .public-catalog-actions > button {
    flex: 1 1 100%;
  }

  .client-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .product-editor-modal,
  .price-calculator-modal,
  .product-tags-modal,
  .public-catalog-modal,
  .client-invoices-modal,
  .leaderboard-participant-modal,
  .client-notifications-modal {
    align-items: end;
    padding: 0.75rem;
  }

  .image-lightbox {
    padding: 0.65rem;
  }

  .image-lightbox-stage {
    min-height: min(56vh, 28rem);
  }

  .product-editor-panel,
  .price-calculator-panel,
  .product-tags-panel,
  .public-catalog-panel,
  .client-invoices-panel,
  .leaderboard-participant-panel,
  .client-notifications-panel {
    max-height: calc(100dvh - 1.5rem);
  }

  .app-tour {
    align-items: end;
    padding: 0.8rem;
  }

  .app-tour-card {
    max-height: calc(100dvh - 1.6rem);
    overflow: auto;
  }

  .app-tour-actions > button {
    flex: 1 1 8rem;
  }
}

.toast {
  position: fixed;
  top: var(--toast-top, 50%);
  left: var(--toast-left, 50%);
  z-index: 4000;
  width: max-content;
  max-width: min(26rem, calc(100vw - 2rem));
  transform: translate(-50%, calc(-50% + 0.5rem));
  opacity: 0;
  pointer-events: none;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-anchored {
  transform: translate(-50%, -0.5rem);
}

.toast.is-visible {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.toast.is-anchored.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast-credit-bonus {
  display: grid;
  gap: 0.25rem;
  text-align: center;
}

.toast-credit-bonus > span {
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0.9;
}

.toast-credit-bonus strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  font-size: 1.02rem;
}

.credit-coin-inline {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
}

.credit-coin-inline img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.12rem 0.18rem rgba(0, 0, 0, 0.25));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.data-actions {
  justify-content: flex-start;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0.65rem 0.75rem;
}

.draft-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.command-station-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
  gap: 1rem;
  align-items: start;
}

.command-station-main,
.command-station-cart {
  align-self: start;
}

.command-station-cart {
  position: sticky;
  top: 1rem;
}

.command-station-controls {
  margin-bottom: 1rem;
}

.station-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.station-product-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0.75rem;
}

.station-product-card .primary-button {
  grid-column: 1 / -1;
}

.games-shell {
  display: grid;
  gap: 1rem;
}

.game-audio-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -0.35rem;
}

.game-music-toggle {
  min-width: 7.25rem;
  justify-content: center;
  gap: 0.35rem;
}

.game-music-toggle.is-on {
  border-color: rgb(var(--accent-rgb) / 0.38);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.game-music-toggle.needs-start {
  border-color: rgba(242, 194, 51, 0.58);
  background: linear-gradient(135deg, rgba(255, 247, 214, 0.96), rgba(255, 255, 255, 0.92));
  color: #6d4b00;
}

.game-music-toggle.is-inline {
  min-width: 6.4rem;
}

.game-music-toggle span {
  display: inline-grid;
  place-items: center;
  width: 1rem;
}

.game-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-hero {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 10rem;
  background:
    radial-gradient(circle at 82% 18%, rgb(var(--accent-rgb) / 0.20), transparent 34%),
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.12), rgba(255, 255, 255, 0.92));
}

.game-hero-copy {
  display: grid;
  gap: 0.55rem;
}

.game-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
}

.game-hero p,
.game-card p,
.game-rules-panel p {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
}

.game-profile-badge {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-width: 8rem;
  padding: 0.9rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.24);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 42px rgb(var(--accent-rgb) / 0.14);
}

.game-profile-badge.is-summary {
  justify-items: stretch;
  align-self: stretch;
  gap: 0.65rem;
  width: min(100%, 22rem);
  min-width: 18rem;
  padding: 0.72rem;
}

.game-profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
}

.game-profile-identity .client-avatar-frame::before {
  inset: -0.18rem;
}

.game-profile-identity .client-avatar {
  width: 3rem;
  font-size: 0.72rem;
}

.game-profile-identity .client-plan-ribbon {
  display: none;
}

.game-profile-name {
  display: grid;
  gap: 0.08rem;
  text-align: left;
}

.game-profile-name strong {
  font-size: 1rem;
  line-height: 1.1;
}

.game-profile-name span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.game-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.game-profile-stat-card {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  min-height: 3.45rem;
  border: 1px solid rgba(16, 20, 22, 0.08);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.46rem 0.52rem;
}

.game-profile-stat-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-profile-stat-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(0.98rem, 2.6vw, 1.24rem);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-profile-stat-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-leaderboard-shell {
  display: grid;
  gap: 0.82rem;
  padding: 0.82rem;
}

.game-leaderboard-header {
  display: grid;
  gap: 0.72rem;
}

.game-leaderboard-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.game-leaderboard-title-row h2 {
  margin: 0.22rem 0 0.05rem;
  line-height: 1;
}

.game-leaderboard-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.game-leaderboard-control {
  display: grid;
  gap: 0.32rem;
}

.game-leaderboard-control > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-leaderboard-game-select,
.game-leaderboard-period-select {
  width: min(16rem, 100%);
}

.game-leaderboard-game-select select,
.game-leaderboard-period-select select {
  width: 100%;
  min-height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 0.68rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-weight: 900;
  padding: 0 0.72rem;
}

.game-leaderboard-carousel {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0.82rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.game-leaderboard-carousel::-webkit-scrollbar {
  display: none;
}

.game-leaderboard-game-pages {
  display: grid;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  align-items: start;
  gap: 0.7rem;
}

.game-leaderboard-game-page {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 0.44rem;
  min-height: 0;
  border: 1px solid rgba(16, 20, 22, 0.08);
  border-radius: 0.82rem;
  padding: 0.58rem;
  isolation: isolate;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.game-leaderboard-game-page::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background-image: var(--game-leaderboard-bg);
  background-position: var(--game-leaderboard-bg-position, center);
  background-size: cover;
  opacity: 0.32;
}

.game-leaderboard-game-page::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74) 56%, rgba(255, 255, 255, 0.56)),
    linear-gradient(180deg, rgb(var(--accent-rgb) / 0.12), transparent);
}

.game-leaderboard-game-page.is-disabled {
  filter: saturate(0.72);
}

.game-unavailable-veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.48);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  pointer-events: auto;
}

.game-leaderboard-game-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.48rem;
}

.game-leaderboard-game-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1rem, 2.5vw, 1.28rem);
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-leaderboard-table-head {
  display: grid;
  grid-template-columns: 1.62rem minmax(0, 1fr) max-content;
  gap: 0.5rem;
  max-width: 40rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.game-leaderboard-table-head span:first-child {
  grid-column: 2;
}

.game-leaderboard-table-head span:last-child {
  justify-self: end;
}

.game-leaderboard-list {
  display: grid;
  gap: 0.28rem;
  max-width: 40rem;
}

.game-leaderboard-row {
  display: grid;
  grid-template-columns: 1.62rem minmax(0, 1fr) max-content;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(16, 20, 22, 0.08);
  border-radius: 0.58rem;
  background: rgba(255, 255, 255, 0.74);
  min-height: 2.42rem;
  padding: 0.26rem 0.44rem;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.game-leaderboard-row:hover,
.game-leaderboard-row:focus-visible {
  border-color: rgb(var(--accent-rgb) / 0.38);
  box-shadow: 0 0.55rem 1.2rem rgba(22, 18, 26, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.game-leaderboard-row.is-top {
  border-color: rgb(var(--accent-rgb) / 0.28);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.10), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.84);
}

.game-leaderboard-rank {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 950;
}

.game-leaderboard-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

.game-leaderboard-player .client-avatar-frame::before {
  inset: -0.12rem;
}

.game-leaderboard-player .client-avatar {
  width: 1.76rem;
  font-size: 0.54rem;
}

.leaderboard-crown {
  position: absolute;
  top: -0.58rem;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 1.16rem;
  height: 0.78rem;
  transform: translateX(-50%) rotate(-3deg);
  filter: drop-shadow(0 0.18rem 0.22rem rgba(24, 22, 28, 0.22));
  pointer-events: none;
}

.leaderboard-crown::before {
  display: block;
  width: 1.05rem;
  height: 0.58rem;
  border: 1px solid rgba(24, 22, 28, 0.18);
  border-bottom: 0;
  border-radius: 0.16rem 0.16rem 0.05rem 0.05rem;
  background: var(--leaderboard-crown-color, #f2c94c);
  clip-path: polygon(0 100%, 0 42%, 24% 66%, 50% 8%, 76% 66%, 100% 42%, 100% 100%);
  content: "";
}

.leaderboard-crown::after {
  position: absolute;
  right: 0.12rem;
  bottom: 0;
  left: 0.12rem;
  height: 0.16rem;
  border: 1px solid rgba(24, 22, 28, 0.18);
  border-radius: 999px;
  background: color-mix(in srgb, var(--leaderboard-crown-color, #f2c94c) 78%, #ffffff);
  content: "";
}

.leaderboard-crown[data-rank="1"] {
  --leaderboard-crown-color: #f2c94c;
}

.leaderboard-crown[data-rank="2"] {
  --leaderboard-crown-color: #cbd5e1;
}

.leaderboard-crown[data-rank="3"] {
  --leaderboard-crown-color: #c1783b;
}

.game-leaderboard-player .client-plan-ribbon {
  display: none;
}

.game-leaderboard-player strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-leaderboard-score {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.25rem;
  min-width: 5.8rem;
  text-align: right;
}

.game-leaderboard-score strong {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
}

.game-leaderboard-score span {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 850;
  text-transform: uppercase;
}

.leaderboard-participant-panel {
  width: min(26rem, 100%);
  padding: 1rem;
}

.leaderboard-participant-panel > .panel-heading {
  margin-bottom: 0.55rem;
}

.leaderboard-participant-panel > .panel-heading p {
  margin: 0.16rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.leaderboard-participant-card {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.16);
  border-radius: calc(var(--radius) - 0.18rem);
  background:
    radial-gradient(circle at 50% 0%, rgb(var(--accent-rgb) / 0.13), transparent 12rem),
    rgba(255, 255, 255, 0.72);
  padding: 1rem;
  text-align: center;
}

.leaderboard-participant-photo {
  display: grid;
  place-items: center;
  min-height: 10.4rem;
  padding-top: 0.55rem;
}

.leaderboard-participant-photo .client-avatar-frame::before {
  inset: -0.42rem;
}

.leaderboard-participant-photo .client-avatar {
  width: min(10rem, 48vw);
  font-size: 1rem;
}

.leaderboard-participant-photo .client-plan-ribbon {
  bottom: -0.68rem;
}

.leaderboard-participant-photo .leaderboard-crown {
  top: -0.78rem;
  width: 1.9rem;
  height: 1.2rem;
}

.leaderboard-participant-photo .leaderboard-crown::before {
  width: 1.7rem;
  height: 0.92rem;
}

.leaderboard-participant-photo .leaderboard-crown::after {
  height: 0.22rem;
}

.leaderboard-participant-copy {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
}

.leaderboard-participant-copy h3 {
  margin: 0;
  max-width: 100%;
  color: var(--text);
  font-size: 1.22rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.leaderboard-participant-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.leaderboard-participant-score {
  display: grid;
  justify-items: center;
  width: 100%;
  border: 1px solid rgb(var(--accent-rgb) / 0.18);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--panel) 88%, var(--soft));
  padding: 0.75rem;
}

.leaderboard-participant-score span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.leaderboard-participant-score strong {
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.leaderboard-participant-score small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.game-avatar-token {
  display: grid;
  place-items: center;
  width: 4.35rem;
  height: 4.35rem;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-strong)),
    var(--accent);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 28px rgb(var(--accent-rgb) / 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-avatar-choice-button {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.game-avatar-choice-button:hover .game-avatar-token {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 18px 34px rgb(var(--accent-rgb) / 0.34);
}

.game-avatar-choice-button:focus-visible {
  outline: 3px solid rgb(var(--accent-rgb) / 0.36);
  outline-offset: 4px;
}

.game-avatar-token.has-image {
  overflow: hidden;
  background: #151819;
  padding: 0.12rem;
}

.game-avatar-token img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
  object-position: center bottom;
}

.game-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.game-stats-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-stat-card,
.game-card,
.game-avatar-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    var(--panel);
  box-shadow: var(--shadow);
}

.game-stat-card {
  display: grid;
  gap: 0.25rem;
  min-height: 6rem;
  padding: 1rem;
}

.game-stat-card span {
  color: var(--muted);
  font-weight: 700;
}

.game-stat-card strong {
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.game-stat-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.game-progress-panel {
  display: grid;
  gap: 0.85rem;
}

.game-progress-track {
  overflow: hidden;
  height: 0.52rem;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.12);
}

.game-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--accent), var(--accent-strong)),
    var(--accent);
  transition: width 320ms ease;
}

.game-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-weight: 800;
}

.game-daily-missions-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 16rem);
  gap: 1rem;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.game-daily-missions-side {
  display: grid;
  gap: 0.65rem;
}

.game-daily-missions-cta {
  justify-self: end;
  min-height: 2.4rem;
}

.game-daily-missions-card h2,
.game-daily-mission-item h3 {
  margin: 0.35rem 0 0;
}

.game-daily-missions-card p,
.game-daily-mission-item p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 800;
}

.game-daily-mission-progress {
  overflow: hidden;
  height: 0.9rem;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.12);
}

.game-daily-mission-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.game-daily-mission-list {
  display: grid;
  gap: 0.75rem;
}

.game-missions-panel {
  display: grid;
  gap: 0.9rem;
}

.game-mission-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(10rem, 1.2fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.24);
  border-radius: calc(var(--radius) * 0.9);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.16), rgba(255, 255, 255, 0.84)),
    rgba(255, 255, 255, 0.9);
}

.game-mission-progress-card div:first-child {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.game-mission-progress-card strong {
  color: var(--text);
  font-size: 1rem;
}

.game-daily-mission-item {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(16, 20, 22, 0.1);
  border-radius: 0.85rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72)),
    var(--panel);
  box-shadow: 0 0.65rem 1.25rem rgba(35, 28, 44, 0.06);
}

.game-daily-mission-item.has-no-media {
  grid-template-columns: minmax(0, 1fr) auto;
}

.game-daily-mission-item.is-login-mission {
  min-height: 3.35rem;
  padding: 0.52rem 0.62rem;
}

.game-daily-mission-item.is-login-mission .game-daily-mission-copy {
  display: grid;
  gap: 0.1rem;
}

.game-daily-mission-item.is-login-mission .game-daily-mission-copy h3 {
  margin-top: 0;
  font-size: 0.94rem;
}

.game-daily-mission-item.is-login-mission .game-daily-mission-copy p {
  display: -webkit-box;
  margin-top: 0;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-daily-mission-item.is-login-mission .status-pill {
  justify-self: start;
  padding: 0.18rem 0.44rem;
  font-size: 0.66rem;
}

.game-daily-mission-item.is-complete {
  border-color: rgba(35, 185, 111, 0.34);
  background:
    linear-gradient(135deg, rgba(35, 185, 111, 0.18), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(35, 185, 111, 0.12),
    0 0.7rem 1.45rem rgba(35, 185, 111, 0.1);
}

.game-daily-mission-item.is-active {
  border-color: rgb(var(--accent-rgb) / 0.28);
}

.game-daily-mission-item.is-locked {
  opacity: 0.72;
}

.game-daily-mission-copy {
  min-width: 0;
}

.game-daily-mission-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(16, 20, 22, 0.12);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0.55rem 1.15rem rgba(16, 20, 22, 0.1);
}

.game-daily-mission-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-daily-mission-media.is-logo img {
  box-sizing: border-box;
  padding: 0.85rem;
  object-fit: contain;
}

.game-daily-mission-icon {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.12);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.16);
}

.game-daily-mission-item.is-complete .game-daily-mission-icon {
  background: rgba(35, 185, 111, 0.16);
  color: #16734a;
  box-shadow: inset 0 0 0 1px rgba(35, 185, 111, 0.24);
}

.game-command-grid,
.game-card-grid,
.game-avatar-grid {
  display: grid;
  gap: 0.8rem;
}

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

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

.game-card {
  display: grid;
  gap: 1rem;
  align-content: space-between;
  min-height: 14rem;
  padding: 1rem;
}

.game-card.has-cover-image {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(5, 8, 12, 0.24), rgba(5, 8, 12, 0.78)),
    linear-gradient(90deg, rgba(5, 8, 12, 0.7), rgba(5, 8, 12, 0.18)),
    var(--game-card-cover-image) var(--game-card-cover-position, center) / cover no-repeat;
  box-shadow: 0 22px 52px rgba(5, 8, 12, 0.22);
}

.game-card.has-cover-image p {
  color: rgba(255, 255, 255, 0.86);
}

.game-card.has-cover-image .status-pill {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.9);
  color: #14191d;
}

.game-card.has-cover-image .primary-button {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.94);
  color: #14191d;
  box-shadow: 0 12px 28px rgba(5, 8, 12, 0.24);
}

.game-card.is-disabled {
  position: relative;
  filter: saturate(0.74);
  opacity: 0.82;
}

.game-card.is-disabled::after {
  content: attr(data-disabled-label);
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.44);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  pointer-events: auto;
}

.game-card.is-disabled.has-cover-image {
  background:
    linear-gradient(180deg, rgba(5, 8, 12, 0.46), rgba(5, 8, 12, 0.86)),
    linear-gradient(90deg, rgba(5, 8, 12, 0.78), rgba(5, 8, 12, 0.36)),
    var(--game-card-cover-image) var(--game-card-cover-position, center) / cover no-repeat;
}

.game-card h3 {
  margin: 0.7rem 0 0.35rem;
  font-size: 1.35rem;
}

.game-avatar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.game-avatar-card {
  display: grid;
  place-items: center;
  gap: 0.7rem;
  min-height: 9rem;
  padding: 1rem;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.game-avatar-card .game-avatar-token {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.game-avatar-card.is-selected {
  border-color: rgb(var(--accent-rgb) / 0.58);
  box-shadow: 0 18px 42px rgb(var(--accent-rgb) / 0.18);
}

.game-reward-ladder {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.game-reward-ladder div,
.game-rule-list span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 0.8);
  background: rgba(255, 255, 255, 0.72);
}

.game-reward-ladder div.is-unlocked {
  border-color: rgb(var(--accent-rgb) / 0.36);
  background: var(--soft);
}

.game-reward-ladder span,
.game-reward-ladder em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.game-rule-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.game-rule-list span {
  grid-template-columns: 1fr;
}

.game-tutorial-panel {
  overflow: hidden;
}

.game-tutorial-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: stretch;
}

.game-tutorial-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 16rem;
  overflow: hidden;
  border: 1px solid rgb(var(--accent-rgb) / 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.16), rgba(255, 255, 255, 0.86)),
    rgba(255, 255, 255, 0.92);
}

.game-tutorial-visual::before,
.game-tutorial-visual::after {
  position: absolute;
  content: "";
}

.game-tutorial-visual::before {
  inset: 16% 18%;
  border: 0.45rem solid rgb(var(--accent-rgb) / 0.18);
  border-radius: 999px;
}

.game-tutorial-visual::after {
  left: 12%;
  right: 12%;
  bottom: 18%;
  height: 0.55rem;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.22);
}

.game-tutorial-token-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.game-tutorial-token-row > span {
  display: grid;
  place-items: center;
  min-width: 4.2rem;
  min-height: 4.2rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.26);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-strong);
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 0.9rem 1.8rem rgba(30, 42, 38, 0.12);
}

.game-tutorial-token-row > span.has-image {
  width: 5rem;
  height: 5rem;
  padding: 0.35rem;
}

.game-tutorial-token-row > span.has-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.game-tutorial-visual.is-prepare-commande .game-tutorial-token-row {
  gap: 0.48rem;
}

.game-tutorial-visual.is-prepare-commande .game-tutorial-token-row > span.has-image {
  width: 4.1rem;
  height: 4.1rem;
  padding: 0.22rem;
}

.game-tutorial-visual.is-prepare-commande .game-tutorial-token-row > span:last-child {
  color: var(--accent-strong);
  transform: none;
}

.game-tutorial-token-row > span:last-child {
  color: #d93737;
  transform: translateY(0.55rem) rotate(5deg);
}

.game-tutorial-token-row > span.is-danger {
  border-color: rgba(217, 55, 55, 0.34);
  background: rgba(255, 246, 246, 0.94);
}

.game-tutorial-copy {
  display: grid;
  align-content: center;
  gap: 0.9rem;
}

.game-tutorial-copy p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.game-tutorial-steps {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: gameTutorialStep;
}

.game-tutorial-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  color: var(--text);
  font-weight: 850;
  line-height: 1.25;
  counter-increment: gameTutorialStep;
}

.game-tutorial-steps li::before {
  display: grid;
  place-items: center;
  width: 1.7rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  content: counter(gameTutorialStep);
  font-size: 0.8rem;
  font-weight: 900;
}

.game-tutorial-steps li.has-step-icon {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  counter-increment: none;
}

.game-tutorial-steps li.has-step-icon::before {
  display: none;
}

.game-tutorial-step-icon {
  display: grid;
  place-items: center;
  width: 2.15rem;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: 0.62rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.12rem;
}

.game-tutorial-step-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-play-panel {
  gap: 0.85rem;
  scroll-margin-top: 5rem;
  -webkit-tap-highlight-color: transparent;
}

.game-play-panel,
.game-play-panel button,
.chase-canvas,
.delivery-canvas {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-play-panel button {
  touch-action: manipulation;
}

body.is-chase-playing {
  overflow: hidden;
}

body.is-chase-playing .topbar,
body.is-chase-playing .app-sidebar,
body.is-chase-playing .mobile-bottom-nav {
  pointer-events: none;
}

body.is-chase-playing .games-view.is-active,
body.is-chase-playing .games-shell {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

body.is-chase-playing .game-play-panel {
  position: fixed;
  inset: 0;
  z-index: 3500;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  gap: 0.55rem;
  margin: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 0.65rem) calc(env(safe-area-inset-right, 0px) + 0.65rem) calc(env(safe-area-inset-bottom, 0px) + 0.65rem) calc(env(safe-area-inset-left, 0px) + 0.65rem);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgb(var(--accent-rgb) / 0.18), transparent 32rem),
    var(--panel);
  pointer-events: auto;
}

body.is-chase-playing .game-play-panel .panel-heading {
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
}

body.is-chase-playing .game-play-panel .panel-heading h2 {
  font-size: clamp(1rem, 4vw, 1.35rem);
}

body.is-chase-playing .game-play-panel .form-hint {
  font-size: 0.78rem;
  line-height: 1.25;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.game-hud span {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 0.85);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 800;
}

.game-hud strong {
  color: var(--text);
  font-size: 1.25rem;
}

.chase-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chase-canvas {
  display: block;
  width: 100%;
  height: min(62vh, 30rem);
  min-height: 20rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.24);
  border-radius: var(--radius);
  background: #fff;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), var(--shadow);
}

body.is-chase-playing .chase-canvas {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.chase-countdown {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.18), rgba(18, 24, 27, 0.18));
  color: var(--accent-strong);
  font-size: clamp(4rem, 24vw, 9rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0.35rem 1.5rem rgba(255, 255, 255, 0.88);
  pointer-events: none;
}

.chase-countdown[hidden] {
  display: none;
}

.quick-game-stage {
  position: relative;
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.quick-game-card {
  display: grid;
  align-content: center;
  gap: 0.85rem;
  min-height: 22rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.24);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top right, rgb(var(--accent-rgb) / 0.16), transparent 42%),
    rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), var(--shadow);
  padding: clamp(1rem, 4vw, 2rem);
}

body.is-chase-playing .quick-game-card {
  height: 100%;
  min-height: 0;
}

.quick-game-card h3 {
  margin: 0;
  font-size: clamp(1.35rem, 5.5vw, 2.35rem);
  line-height: 1.05;
}

.quick-game-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.quick-game-option {
  min-height: 4.25rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--line));
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0.85rem;
  box-shadow: 0 0.7rem 1.4rem rgba(30, 42, 38, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.quick-game-option:active {
  transform: scale(0.98);
}

.quick-game-option:hover,
.quick-game-option:focus-visible {
  border-color: var(--brand-primary);
  box-shadow: 0 0.9rem 1.7rem rgb(var(--accent-rgb) / 0.16);
}

.quick-game-feedback {
  min-height: 1.3rem;
  margin: 0;
  color: var(--accent-strong);
  font-weight: 900;
}

.quick-game-feedback.is-wrong {
  color: #d93737;
}

.quick-game-countdown {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.18), rgba(18, 24, 27, 0.18));
  color: var(--accent-strong);
  font-size: clamp(4rem, 24vw, 9rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0.35rem 1.5rem rgba(255, 255, 255, 0.88);
  pointer-events: none;
}

.quick-game-countdown[hidden] {
  display: none;
}

.prepare-game-hud {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.prepare-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(7rem, 1fr) auto auto;
  gap: 0.55rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.prepare-tutorial-card {
  display: grid;
  gap: 0.2rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.26);
  border-radius: calc(var(--radius) * 0.85);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.12), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.72rem 0.85rem;
}

.prepare-tutorial-card strong {
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.prepare-tutorial-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

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

.prepare-customers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  min-height: 0;
  overflow: hidden;
}

.prepare-customer {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.45rem;
  align-content: start;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--line));
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top, rgb(var(--accent-rgb) / 0.16), transparent 55%),
    rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 0.7rem;
  text-align: left;
  box-shadow: 0 0.9rem 1.8rem rgba(30, 42, 38, 0.1);
}

.prepare-customer.is-urgent {
  border-color: rgba(217, 55, 55, 0.55);
  background:
    radial-gradient(circle at top, rgba(217, 55, 55, 0.16), transparent 55%),
    rgba(255, 255, 255, 0.94);
  animation: prepareUrgentPulse 840ms ease-in-out infinite alternate;
}

.prepare-customer-face {
  display: grid;
  place-items: center;
  width: 2.35rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.prepare-order-bubble {
  display: grid;
  gap: 0.35rem;
  align-self: stretch;
}

.prepare-order-bubble strong {
  font-size: 0.86rem;
}

.prepare-order-bubble span {
  font-weight: 900;
  line-height: 1.15;
}

.prepare-order-bubble em {
  display: block;
  height: 0.42rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 24, 27, 0.12);
}

.prepare-order-bubble i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #be25d8, #f538a9);
}

.prepare-workbench {
  display: grid;
  grid-template-columns: minmax(4.8rem, 0.8fr) minmax(0, 1.5fr) minmax(4.8rem, 0.8fr) 2.35rem;
  gap: 0.55rem;
  align-items: stretch;
}

.prepare-tool-card,
.prepare-product {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 0.85);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 0.7rem 1.4rem rgba(30, 42, 38, 0.08);
}

.prepare-tool-card {
  display: grid;
  gap: 0.35rem;
  place-items: center;
  min-height: 5.4rem;
  padding: 0.65rem;
}

.prepare-tool-visual {
  position: relative;
  display: block;
  width: 3.1rem;
  aspect-ratio: 1;
}

.prepare-tool-box {
  transform: rotate(-2deg);
}

.prepare-tool-box::before {
  content: "";
  position: absolute;
  inset: 0.72rem 0.28rem 0.34rem;
  border: 2px solid rgba(95, 54, 18, 0.42);
  border-radius: 0.35rem;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(95, 54, 18, 0.18) 47% 53%, transparent 54%),
    linear-gradient(135deg, #d99b52, #f0c47e);
  box-shadow: 0 0.4rem 0.8rem rgba(74, 45, 16, 0.18);
}

.prepare-tool-box::after {
  content: "";
  position: absolute;
  left: 0.42rem;
  right: 0.42rem;
  top: 0.42rem;
  height: 1rem;
  clip-path: polygon(0 100%, 22% 0, 50% 52%, 78% 0, 100% 100%);
  background: #f2d3a0;
  border-radius: 0.18rem;
}

.prepare-tool-tape {
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 0 22%, #3b82f6 24% 42%, #1f2937 44% 58%, transparent 60%);
}

.prepare-tool-tape::before {
  content: "";
  position: absolute;
  right: -0.12rem;
  bottom: 0.46rem;
  width: 1.75rem;
  height: 0.74rem;
  border-radius: 0.22rem;
  background: linear-gradient(90deg, #1f2937, #111827);
  transform: rotate(-10deg);
}

.prepare-tool-tape::after {
  content: "";
  position: absolute;
  right: -0.26rem;
  bottom: 0.52rem;
  width: 0.72rem;
  height: 0.48rem;
  background: repeating-linear-gradient(90deg, #d1d5db 0 3px, #6b7280 3px 5px);
  clip-path: polygon(0 0, 100% 16%, 100% 84%, 0 100%);
}

.prepare-tool-visual i {
  position: absolute;
  inset: auto 0.2rem 0.14rem auto;
  width: 0.9rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(18, 24, 27, 0.18);
}

.prepare-box-preview {
  min-height: 5.4rem;
}

.prepare-box-art {
  display: grid;
  gap: 0.35rem;
  place-items: center;
  height: 100%;
  border: 2px dashed rgba(18, 24, 27, 0.22);
  border-radius: calc(var(--radius) * 0.85);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.65rem;
}

.prepare-box-art.is-open {
  border-style: solid;
  border-color: rgb(var(--accent-rgb) / 0.32);
  background: rgba(255, 255, 255, 0.92);
}

.prepare-box-art.is-sealed {
  border-color: rgba(35, 185, 111, 0.48);
  background:
    linear-gradient(135deg, rgba(35, 185, 111, 0.08), transparent),
    rgba(255, 255, 255, 0.92);
}

.prepare-box-art div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.prepare-box-art span {
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.12);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.22rem 0.48rem;
}

.prepare-reset-button {
  align-self: center;
  justify-self: center;
  position: relative;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #24292f;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0.45rem 1rem rgba(17, 24, 39, 0.14);
  touch-action: manipulation;
}

.prepare-reset-button span {
  transform: translateY(-0.03rem);
}

.prepare-inventory {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.45rem;
}

.prepare-product {
  display: grid;
  gap: 0.32rem;
  justify-items: center;
  min-height: 4.8rem;
  padding: 0.5rem;
}

.prepare-product-visual {
  position: relative;
  display: block;
  width: 2.9rem;
  height: 2.55rem;
  filter: drop-shadow(0 0.45rem 0.55rem rgba(15, 23, 42, 0.16));
  pointer-events: none;
}

.prepare-product-visual::before,
.prepare-product-visual::after,
.prepare-product-visual i {
  content: "";
  position: absolute;
  display: block;
}

.prepare-product-visual::before {
  inset: 0.4rem;
  border-radius: 0.82rem;
  background: var(--product-color, var(--brand-primary));
}

.prepare-product-visual::after {
  content: attr(data-token);
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.prepare-product-visual.is-hoodie::before {
  left: 0.62rem;
  right: 0.62rem;
  top: 0.92rem;
  bottom: 0.15rem;
  border-radius: 0.75rem 0.75rem 0.42rem 0.42rem;
  background: var(--product-color, var(--brand-primary));
}

.prepare-product-visual.is-hoodie::after {
  content: "";
  left: 0.88rem;
  top: 0.1rem;
  width: 1.05rem;
  height: 0.95rem;
  border: 0.25rem solid color-mix(in srgb, var(--product-color, var(--brand-primary)) 78%, #111827);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.prepare-product-visual.is-hoodie i {
  left: 0.2rem;
  right: 0.2rem;
  top: 1.16rem;
  height: 0.48rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--product-color, var(--brand-primary)) 72%, #ffffff);
  transform: rotate(-7deg);
}

.prepare-product-visual.is-dragon::before {
  left: 0.46rem;
  top: 1rem;
  width: 1.62rem;
  height: 0.82rem;
  border-radius: 70% 40% 58% 45%;
  background: var(--product-color, var(--brand-primary));
}

.prepare-product-visual.is-dragon::after {
  content: "";
  left: 0.98rem;
  top: 0.38rem;
  width: 0;
  height: 0;
  border-left: 0.58rem solid transparent;
  border-right: 0.16rem solid transparent;
  border-bottom: 0.78rem solid color-mix(in srgb, var(--product-color, var(--brand-primary)) 70%, #ffffff);
  transform: rotate(-14deg);
}

.prepare-product-visual.is-dragon i {
  right: 0.22rem;
  top: 0.74rem;
  width: 0.58rem;
  height: 0.52rem;
  border-radius: 55% 60% 45% 50%;
  background: color-mix(in srgb, var(--product-color, var(--brand-primary)) 86%, #0f172a);
  box-shadow: -1.85rem 0.34rem 0 -0.18rem color-mix(in srgb, var(--product-color, var(--brand-primary)) 72%, #0f172a);
}

.prepare-product-visual.is-keychain::before {
  left: 0.3rem;
  top: 0.12rem;
  width: 1rem;
  height: 1rem;
  border: 0.22rem solid var(--product-color, var(--brand-primary));
  border-radius: 50%;
  background: transparent;
}

.prepare-product-visual.is-keychain::after {
  content: "";
  right: 0.38rem;
  bottom: 0.18rem;
  width: 1.05rem;
  height: 1.2rem;
  border-radius: 0.28rem;
  background: var(--product-color, var(--brand-primary));
  transform: rotate(-12deg);
}

.prepare-product-visual.is-keychain i {
  right: 0.74rem;
  top: 1.15rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: #fff;
  z-index: 1;
}

.prepare-product-visual.is-mug::before {
  left: 0.54rem;
  top: 0.62rem;
  width: 1.48rem;
  height: 1.34rem;
  border-radius: 0.25rem 0.25rem 0.48rem 0.48rem;
  background: var(--product-color, var(--brand-primary));
}

.prepare-product-visual.is-mug::after {
  content: "";
  right: 0.34rem;
  top: 0.88rem;
  width: 0.74rem;
  height: 0.76rem;
  border: 0.2rem solid var(--product-color, var(--brand-primary));
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.prepare-product-visual.is-mug i {
  left: 0.88rem;
  top: 0.08rem;
  width: 0.14rem;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  box-shadow: 0.46rem 0.04rem 0 rgba(15, 23, 42, 0.14), 0.92rem 0.01rem 0 rgba(15, 23, 42, 0.1);
}

.prepare-product-visual.is-cap::before {
  left: 0.48rem;
  top: 0.68rem;
  width: 1.6rem;
  height: 0.9rem;
  border-radius: 999px 999px 0.3rem 0.3rem;
  background: var(--product-color, var(--brand-primary));
}

.prepare-product-visual.is-cap::after {
  content: "";
  right: 0.26rem;
  top: 1.3rem;
  width: 1.22rem;
  height: 0.36rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--product-color, var(--brand-primary)) 70%, #ffffff);
  transform: rotate(8deg);
}

.prepare-product-visual.is-cap i {
  left: 1.22rem;
  top: 0.58rem;
  width: 0.28rem;
  height: 0.18rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.prepare-product-visual.is-sticker::before {
  left: 0.62rem;
  top: 0.42rem;
  width: 1.48rem;
  height: 1.48rem;
  border: 0.08rem solid color-mix(in srgb, var(--product-color, var(--brand-primary)) 74%, #111827);
  border-radius: 0.2rem;
  background: linear-gradient(135deg, #fff 0 35%, var(--product-color, var(--brand-primary)) 36% 100%);
  transform: rotate(-8deg);
}

.prepare-product-visual.is-sticker::after {
  content: "";
  right: 0.68rem;
  top: 0.44rem;
  width: 0;
  height: 0;
  border-top: 0.48rem solid #fff;
  border-left: 0.48rem solid rgba(255, 255, 255, 0.55);
  transform: rotate(-8deg);
}

.prepare-product-visual.is-sticker i {
  left: 1.12rem;
  top: 1.12rem;
  width: 0.56rem;
  height: 0.16rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  transform: rotate(-8deg);
}

.prepare-product-visual.is-candle::before {
  left: 0.72rem;
  bottom: 0.18rem;
  width: 1.4rem;
  height: 1.32rem;
  border: 0.15rem solid var(--product-color, var(--brand-primary));
  border-radius: 0.38rem 0.38rem 0.28rem 0.28rem;
  background: color-mix(in srgb, var(--product-color, var(--brand-primary)) 22%, #ffffff);
}

.prepare-product-visual.is-candle::after {
  content: "";
  left: 1.22rem;
  top: 0.08rem;
  width: 0.38rem;
  height: 0.58rem;
  border-radius: 70% 35% 70% 45%;
  background: linear-gradient(#fde68a, #f97316);
  transform: rotate(12deg);
}

.prepare-product-visual.is-candle i {
  left: 1.36rem;
  top: 0.6rem;
  width: 0.08rem;
  height: 0.34rem;
  border-radius: 999px;
  background: #312e81;
}

.prepare-product-visual.is-figure::before {
  left: 1.12rem;
  top: 0.18rem;
  width: 0.64rem;
  height: 0.64rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--product-color, var(--brand-primary)) 76%, #ffffff);
}

.prepare-product-visual.is-figure::after {
  content: "";
  left: 0.86rem;
  top: 0.9rem;
  width: 1.14rem;
  height: 1.22rem;
  border-radius: 0.58rem 0.58rem 0.32rem 0.32rem;
  background: var(--product-color, var(--brand-primary));
}

.prepare-product-visual.is-figure i {
  left: 0.54rem;
  right: 0.54rem;
  top: 1.26rem;
  height: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--product-color, var(--brand-primary)) 74%, #ffffff);
}

.prepare-product strong {
  font-size: 0.72rem;
  line-height: 1.1;
  text-align: center;
}

.prepare-feedback {
  margin: 0;
}

.prepare-empty-line {
  display: grid;
  place-items: center;
  min-height: 6rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 850;
}

@keyframes prepareUrgentPulse {
  from {
    transform: translateY(0);
    box-shadow: 0 0.9rem 1.8rem rgba(217, 55, 55, 0.1);
  }
  to {
    transform: translateY(-0.12rem);
    box-shadow: 0 1.1rem 2rem rgba(217, 55, 55, 0.2);
  }
}

.delivery-game-hud {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.delivery-stage {
  position: relative;
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.delivery-canvas {
  display: block;
  width: 100%;
  height: min(62vh, 32rem);
  min-height: 22rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.24);
  border-radius: var(--radius);
  background: #16191c;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), var(--shadow);
}

body.is-chase-playing .delivery-canvas {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.delivery-countdown {
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.2), rgba(18, 24, 27, 0.38));
  color: #fff;
  text-shadow: 0 0.35rem 1.5rem rgb(var(--accent-rgb) / 0.45);
}

.live-quiz-panel {
  --live-phone-bg: #15181b;
  --live-phone-line: rgba(255, 255, 255, 0.16);
}

.live-quiz-hud {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-phone-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
}

.live-phone {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(9rem, 1fr) minmax(7rem, 0.85fr) auto auto auto;
  gap: 0.55rem;
  width: min(100%, 24rem);
  height: min(100%, 46rem);
  min-height: 35rem;
  border: 0.72rem solid #16191c;
  border-radius: 2.25rem;
  background:
    radial-gradient(circle at 24% 0%, rgb(var(--accent-rgb) / 0.34), transparent 34%),
    linear-gradient(180deg, #222529 0%, #111416 100%);
  color: #fff;
  box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.3);
  overflow: hidden;
  padding: 0.75rem;
}

.live-phone::before {
  content: "";
  position: absolute;
  top: 0.38rem;
  left: 50%;
  z-index: 2;
  width: 5rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-50%);
}

.live-phone-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.5rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #f538a9, #b81ed3);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 0.34rem 0.74rem;
  box-shadow: 0 0 0 0.22rem rgba(245, 56, 169, 0.18);
}

.live-viewer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.36rem 0.68rem;
}

.live-video {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--live-phone-line);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 68% 18%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(190, 37, 216, 0.48), rgba(0, 0, 0, 0.18));
}

.live-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(1.05) contrast(1.02);
}

.live-video-shine {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, transparent 0 48%, rgba(255, 255, 255, 0.18) 49%, transparent 60%),
    linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.34));
  pointer-events: none;
}

.live-reaction {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  max-width: calc(100% - 1.5rem);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111416;
  font-weight: 900;
  padding: 0.45rem 0.75rem;
  opacity: 0;
  transform: translateY(0.6rem) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.live-reaction.is-correct,
.live-reaction.is-wrong {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: liveReactionPop 520ms ease;
}

.live-reaction.is-correct {
  color: #0f7a3d;
}

.live-reaction.is-wrong {
  color: #b82132;
}

.live-comments {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  overflow: hidden auto;
  min-height: 0;
  padding: 0.2rem 0.1rem;
  scrollbar-width: thin;
}

.live-comment {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  line-height: 1.22;
  padding: 0.42rem 0.55rem;
  animation: liveCommentIn 260ms ease both;
}

.live-comment strong {
  color: #fff;
  font-size: 0.78rem;
}

.live-comment.is-question {
  border-color: rgba(245, 56, 169, 0.42);
  background: rgba(245, 56, 169, 0.18);
}

.live-comment.is-marie {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
}

.live-question-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  color: #15181b;
  padding: 0.72rem;
}

.live-question-card h3 {
  margin: 0.45rem 0 0;
  font-size: clamp(1rem, 4.2vw, 1.28rem);
  line-height: 1.15;
}

.live-answer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.42rem;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}

.live-answer-button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.48rem;
  min-height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
  color: #15181b;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.12;
  padding: 0.58rem 0.68rem;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: normal;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.live-answer-button span {
  display: grid;
  place-items: center;
  width: 1.55rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 0.16);
  color: var(--accent-strong);
  font-weight: 900;
}

.live-answer-button:not(:disabled):hover,
.live-answer-button:not(:disabled):focus-visible {
  border-color: rgba(245, 56, 169, 0.7);
  transform: translateY(-1px);
}

.live-answer-button.is-correct {
  border-color: rgba(28, 148, 74, 0.75);
  background: #e9f8ef;
}

.live-answer-button.is-wrong {
  border-color: rgba(204, 47, 62, 0.75);
  background: #fff0f2;
}

.live-answer-button.is-selected {
  box-shadow: 0 0 0 0.18rem rgba(255, 255, 255, 0.22);
}

.live-marie-answer {
  min-height: 2.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.2;
  padding: 0.65rem 0.72rem;
}

.live-marie-answer:empty {
  display: none;
}

.live-marie-answer.is-correct {
  border-color: rgba(95, 220, 136, 0.28);
  background: rgba(95, 220, 136, 0.14);
}

.live-marie-answer.is-wrong {
  border-color: rgba(255, 97, 115, 0.3);
  background: rgba(255, 97, 115, 0.14);
}

.live-answer-popup {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(12, 14, 16, 0.68);
  backdrop-filter: blur(0.38rem);
  padding: clamp(1rem, 4vw, 2rem);
}

.live-answer-popup[hidden] {
  display: none;
}

.live-answer-popup-card {
  display: grid;
  gap: 0.85rem;
  width: min(100%, 28rem);
  max-height: min(78vh, 34rem);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 1.15rem;
  background: #ffffff;
  color: #15181b;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.34);
  padding: clamp(1rem, 4vw, 1.35rem);
}

.live-answer-popup .status-pill {
  justify-self: start;
}

.live-answer-popup .live-marie-answer {
  min-height: 0;
  border-color: rgba(21, 24, 27, 0.1);
  background: #f6f7f8;
  color: #15181b;
  font-size: clamp(1rem, 3.6vw, 1.18rem);
  line-height: 1.35;
  padding: 0.9rem;
}

.live-answer-popup .live-marie-answer.is-correct {
  border-color: rgba(28, 148, 74, 0.24);
  background: #e9f8ef;
  color: #155331;
}

.live-answer-popup .live-marie-answer.is-wrong {
  border-color: rgba(204, 47, 62, 0.24);
  background: #fff0f2;
  color: #7b1d28;
}

.live-next-actions {
  display: flex;
  justify-content: stretch;
}

.live-next-actions[hidden] {
  display: none;
}

.live-next-button {
  width: 100%;
  min-height: 2.85rem;
}

@keyframes liveCommentIn {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes liveReactionPop {
  0% {
    transform: translateY(0.5rem) scale(0.92);
  }
  55% {
    transform: translateY(-0.15rem) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.game-result-panel {
  justify-items: center;
  text-align: center;
}

.game-result-score {
  font-size: clamp(3rem, 16vw, 7rem);
  font-weight: 900;
  line-height: 1;
  color: var(--accent-strong);
}

body[data-theme="dark"] .game-hero,
body[data-theme="dark"] .game-profile-badge,
body[data-theme="dark"] .game-profile-stat-card,
body[data-theme="dark"] .game-stat-card,
body[data-theme="dark"] .game-mission-progress-card,
body[data-theme="dark"] .game-daily-mission-item,
body[data-theme="dark"] .game-card,
body[data-theme="dark"] .game-avatar-card,
body[data-theme="dark"] .game-leaderboard-game-page,
body[data-theme="dark"] .game-leaderboard-row,
body[data-theme="dark"] .leaderboard-participant-card,
body[data-theme="dark"] .game-tutorial-visual,
body[data-theme="dark"] .game-tutorial-token-row > span,
body[data-theme="dark"] .game-reward-ladder div,
body[data-theme="dark"] .game-rule-list span,
body[data-theme="dark"] .game-hud span {
  background:
    linear-gradient(180deg, rgba(24, 26, 27, 0.94), rgba(24, 26, 27, 0.76)),
    var(--panel);
}

body[data-theme="dark"] .game-mission-progress-card {
  border-color: rgb(var(--accent-rgb) / 0.28);
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.2), rgba(24, 26, 27, 0.82)),
    var(--panel);
}

body[data-theme="dark"] .game-leaderboard-game-page::after {
  background:
    linear-gradient(90deg, rgba(24, 26, 27, 0.96), rgba(24, 26, 27, 0.78) 56%, rgba(24, 26, 27, 0.58)),
    linear-gradient(180deg, rgb(var(--accent-rgb) / 0.16), transparent);
}

body[data-theme="dark"] .game-leaderboard-game-select select,
body[data-theme="dark"] .game-leaderboard-period-select select {
  background: rgba(24, 26, 27, 0.92);
  color: var(--text);
}

body[data-theme="dark"] .game-daily-mission-item.is-complete {
  border-color: rgba(35, 185, 111, 0.38);
  background:
    linear-gradient(135deg, rgba(35, 185, 111, 0.22), rgba(24, 26, 27, 0.82)),
    var(--panel);
}

body[data-theme="dark"] .game-daily-mission-item.is-active {
  border-color: rgb(var(--accent-rgb) / 0.34);
}

body[data-theme="dark"] .game-daily-mission-media {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 760px) {
  .game-hero {
    grid-template-columns: 1fr;
  }

  .game-profile-badge {
    justify-self: stretch;
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
  }

  .game-profile-badge.is-summary {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .game-profile-badge .game-avatar-token {
    grid-row: span 2;
  }

  .game-leaderboard-title-row {
    align-items: flex-start;
  }

  .game-leaderboard-table-head,
  .game-leaderboard-list {
    max-width: none;
  }

  .game-stats-grid,
  .game-card-grid,
  .game-avatar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-tutorial-layout {
    grid-template-columns: 1fr;
  }

  .game-tutorial-visual {
    min-height: 11rem;
  }
}

@media (max-width: 560px) {
  .game-command-grid,
  .game-stats-grid.compact,
  .game-card-grid,
  .game-avatar-grid {
    grid-template-columns: 1fr;
  }

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

  .game-daily-missions-card,
  .game-mission-progress-card,
  .game-daily-mission-item {
    grid-template-columns: 1fr;
  }

  .game-daily-mission-media {
    aspect-ratio: 16 / 7;
  }

  .game-daily-mission-item.has-no-media {
    grid-template-columns: 1fr;
  }

  .game-daily-missions-cta {
    justify-self: stretch;
  }

  .game-reward-ladder div {
    grid-template-columns: 1fr;
  }

  .chase-canvas {
    height: calc(100dvh - 17rem);
    min-height: 18rem;
  }

  body.is-chase-playing .games-view.is-active,
  body.is-chase-playing .games-shell,
  body.is-chase-playing .game-play-panel {
    min-height: 100dvh;
  }

  body.is-chase-playing .game-play-panel {
    margin: 0;
    border-radius: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 0.45rem) calc(env(safe-area-inset-right, 0px) + 0.45rem) calc(env(safe-area-inset-bottom, 0px) + 0.45rem) calc(env(safe-area-inset-left, 0px) + 0.45rem);
  }

  body.is-chase-playing .game-play-panel .panel-heading {
    align-items: flex-start;
  }

  body.is-chase-playing .game-panel-actions {
    gap: 0.35rem;
  }

  body.is-chase-playing .game-music-toggle.is-inline {
    min-width: 5.35rem;
    padding-inline: 0.5rem;
  }

  body.is-chase-playing .game-play-panel .form-hint {
    display: none;
  }

  body.is-chase-playing .game-hud {
    gap: 0.35rem;
  }

  body.is-chase-playing .game-hud span {
    padding: 0.46rem;
    font-size: 0.72rem;
  }

  body.is-chase-playing .game-hud strong {
    font-size: 0.92rem;
  }

  body.is-chase-playing .chase-canvas {
    height: 100%;
    min-height: 0;
  }

  body.is-chase-playing .prepare-game-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .prepare-stage {
    grid-template-rows: auto minmax(8rem, 1fr) auto auto;
    gap: 0.42rem;
  }

  .prepare-tutorial-card {
    padding: 0.5rem 0.58rem;
  }

  .prepare-tutorial-card strong {
    font-size: 0.74rem;
  }

  .prepare-tutorial-card span {
    font-size: 0.68rem;
  }

  .prepare-customers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
  }

  .prepare-customer {
    padding: 0.48rem;
  }

  .prepare-customer-face {
    width: 1.95rem;
  }

  .prepare-order-bubble strong,
  .prepare-order-bubble span {
    font-size: 0.76rem;
  }

  .prepare-workbench {
    grid-template-columns: minmax(3.55rem, 0.72fr) minmax(0, 1.12fr) minmax(3.55rem, 0.72fr) 2.05rem;
  }

  .prepare-reset-button {
    grid-column: auto;
    width: 2.05rem;
    height: 2.05rem;
    font-size: 0.92rem;
  }

  .prepare-tool-card {
    min-height: 4.4rem;
    padding: 0.45rem;
  }

  .prepare-tool-visual {
    width: 2.35rem;
  }

  .prepare-box-preview {
    min-height: 4.4rem;
  }

  .prepare-box-art {
    padding: 0.45rem;
  }

  .prepare-box-art span {
    font-size: 0.68rem;
  }

  .prepare-inventory {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .prepare-product {
    min-height: 3.8rem;
    padding: 0.38rem;
  }

  .prepare-product-visual {
    width: 2.15rem;
    height: 2rem;
    transform: scale(0.82);
    transform-origin: center;
  }

  .prepare-product strong {
    font-size: 0.64rem;
  }

  body.is-chase-playing .delivery-game-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-chase-playing .delivery-canvas {
    height: 100%;
    min-height: 0;
  }

  .quick-game-options {
    grid-template-columns: 1fr;
  }

  .quick-game-option {
    min-height: 3.5rem;
  }

  .live-quiz-panel {
    gap: 0.45rem;
  }

  .live-phone {
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    border-width: 0.48rem;
    border-radius: 1.7rem;
    padding: 0.55rem;
    gap: 0.38rem;
    grid-template-rows: auto minmax(4.5rem, 0.58fr) minmax(2.6rem, 0.34fr) auto minmax(0, 1fr) auto;
  }

  .live-phone::before {
    top: 0.24rem;
    width: 4rem;
  }

  .live-phone-header {
    padding-top: 0.35rem;
  }

  .live-video {
    border-radius: 1.05rem;
  }

  .live-comments {
    gap: 0.28rem;
  }

  .live-comment {
    font-size: 0.74rem;
    padding: 0.32rem 0.42rem;
  }

  .live-question-card {
    max-height: min(7rem, 22dvh);
    overflow: auto;
    padding: 0.55rem;
    scrollbar-width: thin;
  }

  .live-question-card h3 {
    font-size: clamp(0.82rem, 3.35vw, 0.98rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .live-answer-grid {
    gap: 0.3rem;
    align-content: start;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .live-answer-button {
    min-height: 2.24rem;
    font-size: clamp(0.68rem, 2.85vw, 0.78rem);
    line-height: 1.08;
    padding: 0.34rem 0.44rem;
  }

  .live-answer-button span {
    width: 1.35rem;
  }

  .live-marie-answer {
    min-height: 2.2rem;
    font-size: 0.74rem;
    padding: 0.48rem;
  }

  .live-next-button {
    min-height: 2.45rem;
  }

  .live-answer-popup {
    align-items: center;
    padding: 0.85rem;
  }

  .live-answer-popup-card {
    width: min(100%, 22rem);
    gap: 0.65rem;
    padding: 0.85rem;
  }
}

@media (max-width: 560px) and (max-height: 640px) {
  .live-phone {
    grid-template-rows: auto minmax(3.4rem, 0.42fr) minmax(0, 2.1rem) auto minmax(0, 1fr) auto;
    gap: 0.28rem;
    padding: 0.45rem;
  }

  .live-phone-header {
    padding-top: 0.25rem;
  }

  .live-badge,
  .live-viewer-pill {
    min-height: 1.45rem;
    padding: 0.24rem 0.48rem;
    font-size: 0.68rem;
  }

  .live-comments {
    max-height: 2.1rem;
  }

  .live-question-card {
    max-height: 4.7rem;
    padding: 0.42rem;
  }

  .live-question-card h3 {
    margin-top: 0.28rem;
    font-size: 0.78rem;
  }

  .live-answer-grid {
    gap: 0.24rem;
  }

  .live-answer-button {
    min-height: 2.02rem;
    font-size: 0.66rem;
    padding: 0.28rem 0.36rem;
  }

  .live-answer-button span {
    width: 1.16rem;
  }
}

.station-product-thumb {
  width: 4.5rem;
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
}

.station-cart-lines {
  margin-bottom: 0.75rem;
}

.station-cart-item {
  display: grid;
  grid-template-columns: 1fr;
}

.station-qty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.station-summary {
  display: grid;
  gap: 0.55rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0.75rem 0;
  padding: 0.75rem 0;
}

.station-summary div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.station-summary span {
  color: var(--muted);
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.6rem;
}

.readiness-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0.75rem;
}

.readiness-item strong,
.readiness-item small {
  display: block;
}

.readiness-item small {
  margin-top: 0.15rem;
  color: var(--muted);
  line-height: 1.3;
}

.readiness-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  margin-top: 0.25rem;
  background: var(--accent);
}

.readiness-item.is-warn .readiness-dot {
  background: var(--amber);
}

.batch-actions {
  align-items: end;
  grid-column: span 1;
}

.invoice-select-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.invoice-select-row input {
  width: 1.1rem;
  min-height: 1.1rem;
  accent-color: var(--accent);
}

button:focus-visible,
a.ghost-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(var(--accent-rgb) / 0.34);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .access-panel:hover,
  .metric:hover,
  .panel:hover,
  .record:hover {
    border-color: rgb(var(--accent-rgb) / 0.26);
    box-shadow: var(--shadow-strong);
    transform: translateY(-2px);
  }

  .nav-item:hover {
    transform: translateX(2px);
  }

  .nav-item:hover::after,
  .primary-button:hover::after {
    opacity: 1;
    transform: translateX(120%);
    transition: opacity 160ms ease, transform 680ms ease;
  }

  .primary-button:hover,
  .ghost-button:hover,
  .danger-button:hover,
  .chip-button:hover {
    transform: translateY(-1px);
  }

  .nav-item:hover span:first-child {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: no-preference) {
  body {
    animation: page-atmosphere 18s ease-in-out infinite alternate;
  }

  body::before {
    animation: soft-sweep 16s ease-in-out infinite alternate;
  }

  body::after {
    animation: pattern-drift 22s ease-in-out infinite alternate;
  }

  .access-card::before {
    animation: brand-scan 4.8s ease-in-out infinite;
  }

  .access-logo {
    animation: logo-float 6s ease-in-out infinite;
  }

  .view.is-active > .metric-grid,
  .view.is-active > .panel,
  .view.is-active > .split-layout,
  .view.is-active > .prep-layout,
  .view.is-active > .live-layout {
    animation: fade-rise 360ms ease both;
  }

  .nav-item.is-active span:first-child {
    animation: active-breathe 3s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes page-atmosphere {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  }

  to {
    background-position: 0 0, 42px 18px, -36px 28px, 0 0, 0 0;
  }
}

@keyframes soft-sweep {
  from {
    transform: translate3d(-20%, 0, 0);
  }

  to {
    transform: translate3d(10%, 0, 0);
  }
}

@keyframes pattern-drift {
  from {
    transform: translate3d(0, 0, 0) rotate(8deg);
  }

  to {
    transform: translate3d(-3rem, -2rem, 0) rotate(13deg);
  }
}

@keyframes brand-scan {
  0%,
  100% {
    background-position: 160% 0;
  }

  50% {
    background-position: -60% 0;
  }
}

@keyframes logo-float {
  0%,
  100% {
    transform: translateY(0);
  }

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

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes active-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.2);
  }

  50% {
    box-shadow: 0 0 0 7px rgb(var(--accent-rgb) / 0);
  }
}

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

  .app-shell {
    display: block;
    padding-bottom: calc(1rem + var(--keyboard-safe-bottom));
  }

  body {
    background-attachment: scroll;
  }

  body::before,
  body::after {
    display: none;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 0 0 auto;
    width: min(22rem, 86vw);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    border-top: 0;
    border-right: 0;
    border-left: 1px solid var(--line);
    padding: 1rem calc(1rem + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) 1rem;
    transform: translateX(105%);
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

  body.is-nav-open .sidebar {
    transform: translateX(0);
    box-shadow: -18px 0 48px rgba(30, 42, 38, 0.18);
  }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    border: 0;
    background: transparent;
  }

  body.is-nav-open .nav-backdrop {
    display: block;
  }

  body.is-nav-open {
    overflow: hidden;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .brand {
    display: flex;
    margin-bottom: 1rem;
  }

  .nav-list {
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: visible;
    gap: 0.35rem;
    scroll-snap-type: none;
  }

  body[data-space="client"] .nav-list {
    grid-template-columns: 1fr;
  }

  .nav-item {
    grid-template-columns: 1.75rem minmax(0, 1fr) auto;
    justify-items: stretch;
    min-height: 2.85rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
    scroll-snap-align: start;
  }

  .nav-item span:first-child {
    width: 1.5rem;
    height: 1.5rem;
  }

  body[data-space="client"] .app-shell {
    padding-bottom: calc(1rem + var(--keyboard-safe-bottom));
  }

  body.is-keyboard-open .app-shell,
  body.is-keyboard-open[data-space="client"] .app-shell {
    padding-bottom: calc(1rem + var(--keyboard-safe-bottom));
  }

  body[data-space="client"] .sidebar {
    padding: 1rem calc(1rem + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) 1rem;
  }

  body[data-space="client"] .nav-item {
    min-height: 2.85rem;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
  }

  body[data-space="client"] .nav-item span:first-child {
    width: 1.35rem;
    height: 1.35rem;
  }

  .workspace {
    padding: 1rem;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    position: sticky;
    top: 0;
    z-index: 46;
    min-height: 4rem;
    margin: -1rem -1rem 1rem;
    border-color: rgb(var(--accent-rgb) / 0.12);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0.45rem 1rem;
    box-shadow: 0 12px 28px rgba(30, 42, 38, 0.1);
  }

  .topbar-title {
    flex: 1 1 auto;
    gap: 0.55rem;
    overflow: hidden;
  }

  .topbar-title h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.15rem;
  }

  .topbar-title .eyebrow {
    display: none;
  }

  .topbar-logo {
    width: 4.75rem;
    height: auto;
  }

  .topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    justify-content: flex-end;
    width: auto;
    margin-left: auto;
  }

  .client-top-summary {
    max-width: min(12rem, 48vw);
    gap: 0.35rem;
    padding-inline: 0.55rem;
    font-size: 0.72rem;
  }

  .topbar-client-summary {
    max-width: min(9.5rem, 40vw);
    min-height: 0;
    gap: 0.07rem;
    padding: 0;
    font-size: 0.66rem;
  }

  .client-top-summary span {
    min-width: 0;
  }

  .client-top-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-client-summary {
    max-width: none;
    justify-content: flex-start;
    width: auto;
  }

  .topbar-actions button {
    width: auto;
  }

  .topbar-actions .status-pill {
    display: none;
  }

  .metric-grid,
  .command-action-grid,
  .business-control-grid,
  .membership-plan-grid,
  .vip-guide-grid,
  .split-layout,
  .command-station-layout,
  .command-toggle-grid,
  .live-layout,
  .prep-layout,
  .form-grid,
  .branding-editor,
  .profile-photo-editor,
  .receipt-photo-editor {
    grid-template-columns: 1fr;
  }

  .portal-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .portal-metrics .metric {
    min-height: 5.25rem;
    padding: 0.58rem;
  }

  .option-group {
    grid-template-columns: 1fr;
  }

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

  .client-progress-grid {
    grid-template-columns: 1fr;
  }

  .client-notification {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-sale-heading {
    align-items: center;
    flex-direction: row;
  }

  .live-sale-heading .live-mode-menu {
    margin-left: auto;
  }

  .live-mode-trigger {
    min-width: 7.35rem;
  }

  .invoice-tools,
  .batch-actions,
  .portal-catalog-actions {
    width: 100%;
  }

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

  .invoice-tools {
    grid-template-columns: 1fr;
  }

  .invoice-batch-grid {
    grid-template-columns: 1fr;
  }

  .invoice-batch-grid > .batch-actions {
    grid-column: auto;
  }

  .invoice-action-panel {
    padding: 0.75rem;
  }

  .invoice-card-main,
  .payment-record-main {
    grid-template-columns: 1fr;
  }

  .invoice-payment-actions,
  .payment-record-side {
    justify-items: start;
  }

  .invoice-tools .search-input,
  .invoice-tools select {
    width: 100%;
  }

  .search-input {
    max-width: none;
  }

  .clients-directory-actions {
    grid-template-columns: 1fr;
    width: 100%;
    justify-content: stretch;
  }

  .clients-directory-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .clients-directory-actions .search-input,
  .clients-directory-actions select,
  .clients-directory-actions button {
    width: 100%;
  }

  .client-directory-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.65rem;
  }

  .client-directory-main {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .client-directory-finance {
    grid-column: 1 / -1;
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  .client-form-summary-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .client-form-summary-money {
    justify-items: start;
    text-align: left;
  }

  .client-directory-actions-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-main,
  .line-list li,
  .prep-sheet-list li,
  .invoice-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-profile-card .record-main {
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .record-side-actions {
    justify-items: stretch;
  }

  .client-finance-summary {
    justify-items: start;
  }

  .product-record-main {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .catalog-swipe-card {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 10.75rem);
    max-height: calc(100dvh - 10.75rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .catalog-deck-photo,
  .catalog-deck-photo .product-photo-button,
  .catalog-deck-thumb {
    min-height: clamp(9.5rem, 32dvh, 15rem);
    max-height: clamp(9.5rem, 32dvh, 15rem);
  }

  .catalog-deck-actions {
    grid-template-columns: 1fr;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -0.75rem -0.75rem;
    padding: 0.45rem 0.75rem 0.75rem;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.68), #fff 34%),
      var(--panel);
    box-shadow: 0 -0.55rem 1rem rgba(35, 28, 44, 0.06);
  }

  .catalog-deck-body {
    align-content: start;
    gap: 0.62rem;
    min-height: 0;
    padding: 0.75rem;
  }

  .catalog-deck-body h3 {
    font-size: 1.22rem;
    line-height: 1.12;
    margin: 0.35rem 0 0.2rem;
  }

  .catalog-deck-body p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.35;
  }

  .catalog-deck .record-meta {
    gap: 0.28rem;
  }

  .catalog-deck-actions button {
    min-height: 2.75rem;
  }

  .catalog-photo-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .catalog-photo-card {
    grid-template-columns: 1fr;
    padding: 0.55rem;
  }

  .catalog-photo-card .catalog-photo-open {
    grid-row: auto;
  }

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

  .cart-line {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .cart-delivery-options {
    grid-template-columns: 1fr;
  }

  .client-invoice-drop-point-picker {
    grid-template-columns: 1fr;
  }

  .command-station-cart {
    position: static;
  }

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

  .invoice-paper {
    min-width: 0;
  }

  .invoice-header > div:last-child,
  .invoice-table th:nth-child(n+2),
  .invoice-table td:nth-child(n+2) {
    text-align: left;
  }

  .invoice-brand {
    align-items: flex-start;
  }

  .invoice-table,
  .invoice-table thead,
  .invoice-table tbody,
  .invoice-table tr,
  .invoice-table th,
  .invoice-table td {
    display: block;
  }

  .invoice-table th {
    display: none;
  }

  .invoice-table td {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.75rem;
    padding: 0.45rem 0;
  }

  .invoice-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }

  .invoice-payment-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .prep-line {
    grid-template-columns: 1.2rem minmax(0, 1fr);
  }

  .prep-line strong {
    grid-column: 2;
  }

  .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .row-actions > button,
  .row-actions > a,
  .row-actions > .primary-button,
  .row-actions > .ghost-button,
  .row-actions > .danger-button,
  .row-actions > .chip-button {
    width: 100%;
    min-width: 0;
  }

  .client-directory-actions-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-item {
    display: grid;
  }
}

@media (max-width: 520px) {
  .topbar-logo {
    width: 3.25rem;
  }

  .topbar-actions {
    gap: 0.3rem;
  }

  .client-top-summary {
    align-items: stretch;
    flex-direction: column;
    gap: 0.05rem;
    max-width: 7.8rem;
    min-height: 2.5rem;
    padding-block: 0.25rem;
    line-height: 1.05;
    font-size: 0.66rem;
  }

  .topbar-client-summary {
    display: inline-grid;
    justify-items: center;
    gap: 0.06rem;
    max-width: min(8.75rem, 42vw);
    min-height: 0;
    padding-block: 0;
    line-height: 1.05;
  }

  .topbar-client-summary span {
    justify-content: center;
  }

  .topbar-client-summary .client-credit-label,
  .topbar-client-summary .client-credit-equivalent {
    font-size: 0.52rem;
  }

  .topbar-client-summary .client-credit-pill {
    min-height: 1.42rem;
    gap: 0.22rem;
    padding: 0.13rem 0.26rem;
  }

  .topbar-client-summary .client-credit-pill strong {
    max-width: 7rem;
    font-size: 0.74rem;
  }

  .topbar-client-summary .client-credit-coin {
    width: 1.04rem;
    height: 1.04rem;
  }

  .client-top-summary span {
    justify-content: space-between;
    width: 100%;
  }

  .nav-client-summary {
    align-items: center;
    flex-direction: row;
    gap: 0.35rem;
    max-width: none;
    min-height: auto;
    padding: 0 0.15rem;
    line-height: 1.2;
    font-size: 0.72rem;
  }

  .nav-client-summary span {
    justify-content: flex-start;
    width: auto;
  }

  .icon-button {
    width: 2.5rem;
    height: 2.5rem;
  }

  .portal-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .portal-metrics .metric {
    min-height: 4.85rem;
    padding: 0.48rem;
  }

  .portal-metrics .metric span,
  .portal-metrics .metric small {
    font-size: 0.68rem;
  }

  .portal-metrics .metric strong {
    font-size: clamp(0.92rem, 4vw, 1.15rem);
  }

  .profile-photo-editor {
    grid-template-columns: 1fr;
  }

  .profile-photo-card {
    min-width: 0;
  }

  .profile-photo-editor .profile-photo-preview {
    width: 100%;
    min-width: 0;
  }

  .profile-referral-card {
    align-items: stretch;
    flex-direction: column;
  }
}

.client-notifications-modal {
  display: block;
  padding: 0;
  pointer-events: none;
}

.client-notifications-backdrop {
  background: rgba(13, 17, 18, 0.42);
  pointer-events: auto;
}

body.has-client-notifications-modal {
  overflow: hidden;
}

body.has-client-form-modal {
  overflow: hidden;
}

.client-notifications-panel {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(27rem, 88vw);
  max-height: none;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(17, 23, 24, 0.98), rgba(30, 36, 38, 0.96)),
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.28), transparent 18rem);
  color: white;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  transform: translateX(0);
  animation: notificationsDrawerIn 220ms ease both;
  box-shadow: 20px 0 54px rgba(12, 16, 18, 0.26);
  pointer-events: auto;
}

.client-notifications-panel .panel-heading {
  align-items: center;
  flex-direction: row;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.client-notifications-panel .panel-heading p,
.client-notifications-panel .muted {
  color: rgba(255, 255, 255, 0.68);
}

.client-notifications-panel .panel-heading h2,
.client-notifications-panel .client-notifications-header strong,
.client-notifications-panel .client-notification-target strong {
  color: white;
}

.client-notifications-panel .icon-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.client-notifications-panel .client-notification-stack {
  align-content: start;
  align-items: start;
  display: grid;
  grid-auto-rows: max-content;
  justify-items: stretch;
  overflow: auto;
  padding: 0.1rem 0.15rem 0.35rem;
}

.client-notifications-panel #client-notifications-modal-list {
  grid-template-rows: auto auto;
}

.client-notifications-panel #client-notifications-modal-list > .client-notification-stack {
  min-height: 0;
  overflow: visible;
}

.client-notifications-panel .client-notification {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.48rem 0.1rem;
}

.client-notifications-panel .client-notification.is-unread {
  border-bottom-color: rgb(var(--accent-rgb) / 0.36);
  border-radius: 0.78rem;
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.32), rgb(var(--accent-rgb) / 0.12) 58%, rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 0 0 1px rgb(var(--accent-rgb) / 0.22),
    0 0.65rem 1.45rem rgb(var(--accent-rgb) / 0.1);
  padding: 0.55rem 0.45rem;
}

.client-notifications-panel .client-notification:not(.is-unread) {
  background: transparent;
  box-shadow: none;
}

.client-notifications-panel .client-notification-target p {
  color: rgba(255, 255, 255, 0.78);
}

.client-notifications-panel .client-notification-target {
  display: grid;
  grid-template-columns: 2.55rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border-radius: 0.65rem;
  padding: 0.18rem 0.2rem;
}

.client-notifications-panel .client-notification-target:hover {
  background: rgba(255, 255, 255, 0.07);
}

.client-notifications-panel .client-notification-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.client-notifications-panel .client-notification-copy strong,
.client-notifications-panel .client-notification-copy p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-notifications-panel .client-notification-copy strong {
  font-size: 0.88rem;
  white-space: nowrap;
}

.client-notifications-panel .client-notification-copy p {
  display: -webkit-box;
  font-size: 0.8rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.client-notifications-panel .client-notification.is-message .client-notification-copy p {
  display: block;
  overflow: visible;
  white-space: pre-line;
  -webkit-line-clamp: unset;
}

.client-notifications-panel .client-notification-thumb {
  display: inline-grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0.45rem 1.1rem rgba(0, 0, 0, 0.16);
}

.client-notifications-panel .client-notification-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-notifications-panel .client-notification-thumb.is-logo img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.client-notifications-panel .record-actions {
  flex: 0 0 auto;
  gap: 0.35rem;
}

.client-notifications-panel .ghost-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.client-notifications-panel .tag {
  box-shadow: inset 0 0 0 1px rgba(16, 20, 22, 0.16);
}

@keyframes notificationsDrawerIn {
  from {
    opacity: 0.88;
    transform: translateX(-104%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.portal-daily-missions {
  margin-top: -0.1rem;
}

.portal-daily-missions .game-daily-missions-card {
  border-color: color-mix(in srgb, var(--brand-primary) 30%, rgba(16, 20, 22, 0.2));
  box-shadow:
    inset 0 0 0 1px rgba(16, 20, 22, 0.08),
    0 0.7rem 1.35rem rgba(35, 28, 44, 0.06);
  gap: 0.55rem;
  padding: 0.68rem 0.75rem;
}

.portal-daily-missions .game-daily-missions-card h2 {
  font-size: 1rem;
}

.portal-daily-missions .game-daily-missions-card p {
  font-size: 0.78rem;
}

.portal-daily-missions .game-daily-missions-cta {
  min-height: 2.1rem;
  padding: 0.35rem 0.65rem;
}

.portal-daily-missions .game-daily-mission-progress {
  height: 0.58rem;
}

.portal-notification-ticker,
.portal-vip-strip-card,
.portal-daily-missions .game-daily-missions-card,
.portal-metrics .metric,
.portal-featured-strip,
.client-progress-panel,
.client-home-invoices-panel {
  border-color: color-mix(in srgb, var(--line) 62%, rgba(16, 20, 22, 0.32));
}

.status-pill,
.tag,
.portal-notification-ticker-label,
.primary-button,
.client-top-summary[data-has-credit="true"]:not(.topbar-client-summary),
.nav-item.is-active span:first-child,
.portal-vip-progress-track,
.game-daily-mission-progress {
  box-shadow:
    inset 0 0 0 1px rgba(16, 20, 22, 0.16),
    0 0.45rem 1rem rgb(var(--accent-rgb) / 0.08);
}

.topbar-client-summary[data-has-credit="true"] .client-credit-pill {
  animation: creditAvailableBeat 8s ease-in-out infinite;
  transform-origin: center;
}

@keyframes creditAvailableBeat {
  0%,
  82%,
  100% {
    transform: scale(1) rotateY(0deg);
  }
  86% {
    transform: scale(1.045) rotateY(-8deg);
    box-shadow:
      inset 0 0 0 1px rgba(16, 20, 22, 0.2),
      0 0.75rem 1.45rem rgb(var(--accent-rgb) / 0.18);
  }
  91% {
    transform: scale(1.03) rotateY(7deg);
  }
  96% {
    transform: scale(1) rotateY(0deg);
  }
}

@media (max-width: 600px) {
  .reward-info-rules,
  .reward-info-split {
    grid-template-columns: 1fr;
  }

  .reward-info-hero {
    grid-template-columns: 2.8rem minmax(0, 1fr);
    padding: 0.8rem;
  }

  .reward-info-icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.9rem;
  }

  .client-notifications-modal {
    align-items: stretch;
    padding: 0;
  }

  .client-notifications-panel {
    width: min(24rem, 88vw);
    max-height: none;
    padding: max(1rem, env(safe-area-inset-top)) 0.85rem max(1rem, env(safe-area-inset-bottom));
  }

  .client-notifications-panel .client-notification {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .client-notifications-panel .record-actions {
    justify-content: flex-start;
    padding-left: 3.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-client-summary[data-has-credit="true"] .client-credit-pill,
  .client-notifications-panel {
    animation: none;
  }
}

@media print {
  body {
    background: white;
  }

  body::before,
  body::after {
    display: none;
  }

  body[data-print-mode="prep"] .sidebar,
  body[data-print-mode="prep"] .topbar,
  body[data-print-mode="prep"] .panel:not(.prep-sheet-panel),
  body[data-print-mode="prep"] .toast,
  body[data-print-mode="invoice"] .sidebar,
  body[data-print-mode="invoice"] .topbar,
  body[data-print-mode="invoice"] .panel:not(.invoice-detail-panel),
  body[data-print-mode="invoice"] .toast,
  body[data-print-mode="business-invoice"] .app-shell,
  body[data-print-mode="business-invoice"] .toast,
  body[data-print-mode="business-invoice"] .business-invoice-backdrop,
  body[data-print-mode="business-invoice"] .business-invoice-panel > .panel-heading,
  body[data-print-mode="business-invoice"] .business-invoice-actions,
  body[data-print-mode="batch-print"] .app-shell,
  body[data-print-mode="batch-print"] .toast,
  body[data-print-mode="batch-print"] .business-invoice-modal,
  body[data-print-mode="batch-print"] .business-prep-modal {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .prep-layout {
    display: block;
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 0;
  }

  body[data-print-mode="prep"] .view,
  body[data-print-mode="invoice"] .view {
    display: none !important;
  }

  body[data-print-mode="prep"] #preparation,
  body[data-print-mode="invoice"] #invoices {
    display: block !important;
  }

  body[data-print-mode="business-invoice"] .business-invoice-modal {
    position: static;
    display: block;
    padding: 0;
  }

  body[data-print-mode="business-invoice"] .business-invoice-panel {
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body[data-print-mode="business-invoice"] .business-invoice-panel::before {
    display: none;
  }

  body[data-print-mode="business-invoice"] .business-invoice-detail {
    overflow: visible;
    border: 0;
    padding: 0;
  }

  body[data-print-mode="batch-print"] .batch-print-stage {
    display: block;
    padding: 0;
  }

  body[data-print-mode="batch-print"] .batch-print-page {
    margin: 0 0 1rem;
    padding: 0;
  }

  .prep-sheet-panel,
  .invoice-detail-panel {
    border: 0;
    box-shadow: none;
  }

  .prep-sheet-panel .panel-heading button,
  .invoice-detail-panel .panel-heading button,
  .invoice-draft {
    display: none;
  }

  .invoice-paper {
    min-width: 0;
  }
}

/* Final prepare-orders scene overrides, kept after legacy game styles. */
.prepare-stage {
  isolation: isolate;
  grid-template-rows: auto minmax(10.8rem, 1.1fr) auto auto;
  gap: 0.65rem;
  padding: 0.68rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.18);
  border-radius: calc(var(--radius) * 0.95);
  background:
    linear-gradient(180deg, rgba(226, 239, 236, 0.94) 0 28%, rgba(249, 240, 229, 0.95) 28% 57%, rgba(74, 59, 49, 0.94) 57% 65%, rgba(34, 38, 42, 0.96) 65% 100%),
    #f7efe8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
  touch-action: manipulation;
}

.prepare-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 1rem;
  right: 1rem;
  top: 3.2rem;
  height: 5.8rem;
  border-radius: calc(var(--radius) * 0.8);
  background:
    linear-gradient(90deg, rgba(71, 85, 105, 0.26) 0 1px, transparent 1px 18%),
    linear-gradient(180deg, transparent 0 32%, rgba(100, 116, 139, 0.28) 33% 35%, transparent 36% 68%, rgba(100, 116, 139, 0.22) 69% 71%, transparent 72%),
    rgba(255, 255, 255, 0.38);
}

.prepare-tutorial-card {
  border-color: rgba(124, 45, 53, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(244, 230, 222, 0.9)),
    #fff;
  box-shadow: 0 0.55rem 1.2rem rgba(24, 30, 35, 0.08);
}

.prepare-customers {
  position: relative;
  align-items: end;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 10.8rem;
  overflow: visible;
  padding: 0.15rem 0.32rem 0;
  touch-action: manipulation;
}

.prepare-customers::after {
  content: "";
  position: absolute;
  left: -0.35rem;
  right: -0.35rem;
  bottom: 0;
  height: 2.45rem;
  border-radius: 0.7rem 0.7rem 0.95rem 0.95rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, #36251f, #6f4634 50%, #34241f);
  box-shadow: 0 -0.22rem 0 rgba(255, 255, 255, 0.22), 0 0.9rem 1.8rem rgba(17, 24, 39, 0.18);
  pointer-events: none;
}

.prepare-customer,
.prepare-customer.is-urgent {
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(5.2rem, 1fr);
  justify-items: center;
  gap: 0.25rem;
  min-height: 10.2rem;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  animation: none;
  touch-action: manipulation;
}

.prepare-customer.is-urgent .prepare-order-bubble {
  border-color: rgba(217, 55, 55, 0.55);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0.7rem 1.35rem rgba(217, 55, 55, 0.18);
  animation: prepareUrgentPulse 840ms ease-in-out infinite alternate;
}

.prepare-order-bubble {
  width: min(100%, 10.5rem);
  min-height: 4.5rem;
  padding: 0.48rem 0.5rem 0.5rem;
  border: 1px solid rgba(124, 45, 53, 0.2);
  border-radius: 0.82rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0.65rem 1.2rem rgba(17, 24, 39, 0.12);
}

.prepare-bubble-top {
  display: flex;
}

.prepare-bubble-top strong {
  color: #6f2430;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prepare-bubble-top small {
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.25rem 0.38rem;
}

.prepare-customer.is-urgent .prepare-bubble-top small {
  background: #d93737;
}

.prepare-order-items {
  display: grid;
}

.prepare-order-bubble em {
  margin-top: 0.32rem;
  height: 0.36rem;
  background: rgba(17, 24, 39, 0.1);
}

.prepare-order-bubble i {
  background: linear-gradient(90deg, #23b96f, #f538a9);
}

.prepare-workbench {
  grid-template-columns: minmax(5.8rem, 0.82fr) minmax(0, 1.7fr) minmax(5.8rem, 0.82fr) 2.35rem;
  gap: 0.62rem;
  padding: 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: calc(var(--radius) * 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #2f3a40, #171b1f);
  box-shadow: inset 0 0.22rem 0 rgba(255, 255, 255, 0.08), 0 0.8rem 1.6rem rgba(17, 24, 39, 0.18);
  touch-action: manipulation;
}

.prepare-tool-card,
.prepare-product {
  position: relative;
  z-index: 2;
  border-color: rgba(17, 24, 39, 0.1);
  background: rgba(255, 255, 255, 0.95);
  touch-action: manipulation;
}

.prepare-tool-card {
  min-height: 6.3rem;
  padding: 0.48rem;
}

.prepare-tool-visual.prepare-tool-image {
  width: min(100%, 5.8rem);
  height: 4rem;
  aspect-ratio: auto;
  transform: none;
}

.prepare-tool-visual.prepare-tool-image::before,
.prepare-tool-visual.prepare-tool-image::after {
  display: none;
}

.prepare-tool-visual.prepare-tool-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.45rem;
  pointer-events: none;
}

.prepare-box-preview {
  min-height: 6.3rem;
}

.prepare-box-art {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 229, 214, 0.9)),
    #fff;
  padding: 0.48rem;
}

.prepare-box-art img {
  position: absolute;
  inset: 0.1rem;
  width: calc(100% - 0.2rem);
  height: calc(100% - 0.2rem);
  object-fit: contain;
  object-position: center;
  opacity: 0.88;
  pointer-events: none;
}

.prepare-box-art strong {
  position: relative;
  z-index: 1;
  justify-self: start;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1;
  overflow: hidden;
  padding: 0.28rem 0.48rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prepare-packed-items {
  display: flex;
}

.prepare-packed-chip,
.prepare-packed-empty {
  display: inline-flex;
}

.prepare-box-art .prepare-packed-chip,
.prepare-box-art .prepare-packed-empty {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #24292f;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.2rem 0.36rem;
}

.prepare-inventory {
  gap: 0.42rem;
  padding: 0.48rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: calc(var(--radius) * 0.85);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0)),
    #20262b;
  touch-action: manipulation;
}

.prepare-product {
  min-height: 4.6rem;
  padding: 0.45rem 0.35rem;
}

.prepare-product strong {
  max-width: 100%;
  color: #24292f;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prepare-empty-line {
  min-height: 9.6rem;
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.42);
  color: #4b5563;
}

body[data-theme="dark"] .prepare-stage {
  background:
    linear-gradient(180deg, rgba(29, 42, 45, 0.96) 0 28%, rgba(56, 45, 39, 0.96) 28% 57%, rgba(64, 49, 40, 0.96) 57% 65%, rgba(18, 22, 25, 0.98) 65% 100%),
    #171b1f;
}

body[data-theme="dark"] .prepare-order-bubble,
body[data-theme="dark"] .prepare-tool-card,
body[data-theme="dark"] .prepare-product,
body[data-theme="dark"] .prepare-box-art {
  background: rgba(250, 250, 250, 0.95);
  color: #24292f;
}

@media (max-width: 760px) {
  .prepare-stage {
    grid-template-rows: auto minmax(12.2rem, 1fr) auto auto;
    gap: 0.44rem;
    padding: 0.46rem;
  }

  .prepare-customers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 12.2rem;
    gap: 0.3rem;
    padding-inline: 0.12rem;
  }

  .prepare-customer,
  .prepare-customer.is-urgent {
    min-height: 5.9rem;
    grid-template-rows: auto minmax(3.85rem, 1fr);
  }

  .prepare-order-bubble {
    min-height: 3.55rem;
    padding: 0.34rem 0.36rem 0.38rem;
    border-radius: 0.62rem;
  }

  .prepare-workbench {
    grid-template-columns: minmax(3.55rem, 0.72fr) minmax(0, 1.12fr) minmax(3.55rem, 0.72fr) 2.05rem;
    gap: 0.36rem;
    padding: 0.42rem;
  }

  .prepare-reset-button {
    width: 2.05rem;
    height: 2.05rem;
    font-size: 0.92rem;
  }

  .prepare-tool-card {
    min-height: 4.8rem;
    padding: 0.34rem;
  }

  .prepare-tool-visual.prepare-tool-image {
    height: 2.7rem;
  }

  .prepare-box-preview {
    min-height: 4.8rem;
  }

  .prepare-inventory {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.28rem;
    padding: 0.34rem;
  }

  .prepare-product {
    min-height: 3.75rem;
    padding: 0.32rem 0.22rem;
  }

  .prepare-product strong {
    font-size: 0.58rem;
  }
}

.game-tutorial-visual.is-prepare-commande .game-tutorial-token-row > span.has-client,
.game-tutorial-visual.is-prepare-commande .game-tutorial-token-row > span.has-image {
  width: 4.1rem;
  height: 4.1rem;
  padding: 0.22rem;
}

.tutorial-client-photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0.6rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    #f4d1bd;
  box-shadow: inset 0 -0.28rem 0 rgba(87, 46, 34, 0.1);
}

.tutorial-client-photo.has-image {
  display: grid;
  place-items: center;
  overflow: visible;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 -0.18rem 0 rgba(87, 46, 34, 0.08);
}

.tutorial-client-photo.has-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 0.3rem 0.42rem rgba(15, 23, 42, 0.18));
}

.tutorial-client-head {
  position: absolute;
  left: 50%;
  top: 0.62rem;
  width: 1.72rem;
  height: 1.85rem;
  border-radius: 48% 48% 44% 44%;
  background: #e8b88e;
  transform: translateX(-50%);
}

.tutorial-client-hair {
  position: absolute;
  left: 0.1rem;
  right: 0.1rem;
  top: -0.08rem;
  height: 0.66rem;
  border-radius: 999px 999px 0.48rem 0.48rem;
  background: #3b2418;
}

.tutorial-client-hair::after {
  content: "";
  position: absolute;
  right: -0.08rem;
  top: 0.22rem;
  width: 0.42rem;
  height: 0.92rem;
  border-radius: 999px;
  background: #3b2418;
  transform: rotate(-8deg);
}

.tutorial-client-eyes {
  position: absolute;
  left: 0.46rem;
  right: 0.46rem;
  top: 0.88rem;
  height: 0.14rem;
  border-radius: 999px;
  box-shadow: -0.26rem 0 0 #17202a, 0.26rem 0 0 #17202a;
}

.tutorial-client-mouth {
  position: absolute;
  left: 50%;
  bottom: 0.34rem;
  width: 0.56rem;
  height: 0.24rem;
  border-bottom: 0.1rem solid rgba(73, 33, 22, 0.58);
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.tutorial-client-shirt {
  position: absolute;
  left: 50%;
  bottom: -0.18rem;
  width: 2.8rem;
  height: 1.55rem;
  border-radius: 0.88rem 0.88rem 0.35rem 0.35rem;
  background:
    linear-gradient(90deg, transparent 0 34%, #293241 34% 66%, transparent 66%),
    #7c2d35;
  transform: translateX(-50%);
}

.game-tutorial-step-icon.is-client {
  padding: 0.18rem;
}

.game-tutorial-step-icon .tutorial-client-photo.is-small .tutorial-client-head {
  top: 0.32rem;
  width: 1rem;
  height: 1.1rem;
}

.game-tutorial-step-icon .tutorial-client-photo.is-small .tutorial-client-hair {
  height: 0.42rem;
}

.game-tutorial-step-icon .tutorial-client-photo.is-small .tutorial-client-eyes {
  left: 0.28rem;
  right: 0.28rem;
  top: 0.52rem;
  box-shadow: -0.16rem 0 0 #17202a, 0.16rem 0 0 #17202a;
}

.game-tutorial-step-icon .tutorial-client-photo.is-small .tutorial-client-mouth {
  bottom: 0.2rem;
  width: 0.34rem;
}

.game-tutorial-step-icon .tutorial-client-photo.is-small .tutorial-client-shirt {
  width: 1.75rem;
  height: 0.9rem;
}

.prepare-customers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prepare-customer-person.has-image {
  display: grid;
  place-items: start center;
  width: 5rem;
  height: 5.1rem;
  margin-top: 0;
  overflow: hidden;
  pointer-events: none;
}

.prepare-customer-person.has-image img {
  display: block;
  width: auto;
  max-width: none;
  height: 9.25rem;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
}

.prepare-customer-slot.is-empty {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: end center;
  min-height: 10.2rem;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.44);
  border-radius: 0.78rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.16);
  padding-bottom: 1.18rem;
}

.prepare-customer-slot.is-empty span {
  width: 3.2rem;
  height: 4.65rem;
  border-radius: 999px 999px 0.62rem 0.62rem;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.5) 0 0.84rem, transparent 0.86rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
  opacity: 0.62;
}

body[data-theme="dark"] .prepare-customer-slot.is-empty {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.prepare-panel-heading {
  align-items: start;
}

.prepare-heading-side {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.prepare-heading-side .game-panel-actions {
  justify-content: end;
}

.prepare-top-stats {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.prepare-top-stats span,
.prepare-game-hud span {
  min-height: 0;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent));
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.05;
  padding: 0.42rem 0.55rem;
}

.prepare-top-stats strong,
.prepare-game-hud strong {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.05;
}

.prepare-game-hud {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.36rem;
}

.prepare-stage {
  grid-template-rows: auto minmax(10rem, 1fr) auto auto;
}

.prepare-workbench {
  grid-template-columns: minmax(4.6rem, 0.78fr) minmax(0, 1.24fr) minmax(4.6rem, 0.78fr) 2.12rem;
  gap: 0.46rem;
  align-items: center;
  height: 5.05rem;
  min-height: 5.05rem;
  padding: 0.5rem;
}

.prepare-tool-card {
  width: 100%;
  height: 100%;
  min-height: 5.05rem;
  max-height: 5.05rem;
  padding: 0.4rem;
}

.prepare-tool-visual.prepare-tool-image {
  height: 3.2rem;
}

.prepare-box-preview {
  height: 5.05rem;
  min-height: 5.05rem;
  max-height: 5.05rem;
  overflow: hidden;
}

.prepare-reset-button {
  width: 2.08rem;
  height: 2.08rem;
}

.prepare-inventory {
  grid-auto-rows: minmax(4.05rem, auto);
  align-content: start;
  min-height: 8.6rem;
}

.prepare-product {
  min-height: 4.05rem;
}

@media (max-width: 760px) {
  .prepare-customers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.22rem;
  }

  .prepare-panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
    align-items: start;
  }

  .prepare-heading-side {
    gap: 0.28rem;
  }

  .prepare-heading-side .game-panel-actions {
    gap: 0.28rem;
  }

  .prepare-top-stats span,
  .prepare-game-hud span {
    border-radius: 0.42rem;
    font-size: 0.62rem;
    padding: 0.3rem 0.38rem;
  }

  .prepare-top-stats strong,
  .prepare-game-hud strong {
    font-size: 0.78rem;
  }

  .prepare-game-hud {
    gap: 0.28rem;
  }

  .prepare-stage {
    grid-template-rows: auto minmax(10.5rem, 1fr) auto auto;
    gap: 0.36rem;
  }

  .prepare-customer-person.has-image {
    width: 3.25rem;
    height: 3.55rem;
    margin-top: 0;
  }

  .prepare-customer-person.has-image img {
    height: 6.45rem;
  }

  .prepare-customer-slot.is-empty {
    min-height: 5.9rem;
    padding-bottom: 0.74rem;
  }

  .prepare-customer-slot.is-empty span {
    width: 2.1rem;
    height: 3.1rem;
  }

  .prepare-workbench {
    grid-template-columns: minmax(3.3rem, 0.74fr) minmax(0, 1.02fr) minmax(3.3rem, 0.74fr) 1.9rem;
    gap: 0.28rem;
    height: 4.05rem;
    min-height: 4.05rem;
    padding: 0.32rem;
  }

  .prepare-tool-card {
    height: 100%;
    min-height: 4.05rem;
    max-height: 4.05rem;
    padding: 0.25rem;
  }

  .prepare-tool-card strong {
    font-size: 0.58rem;
  }

  .prepare-tool-visual.prepare-tool-image {
    height: 2.35rem;
  }

  .prepare-box-preview {
    height: 4.05rem;
    min-height: 4.05rem;
    max-height: 4.05rem;
  }

  .prepare-reset-button {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.84rem;
  }

  .prepare-inventory {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(3.35rem, auto);
    min-height: 7.1rem;
    gap: 0.26rem;
    padding: 0.3rem;
  }

  .prepare-product {
    min-height: 3.35rem;
    padding: 0.26rem 0.18rem;
  }

  .prepare-product-visual {
    width: 2.25rem;
    height: 2rem;
  }

  .prepare-product strong {
    font-size: 0.55rem;
  }
}

/* Prepare orders v112: compact game HUD and in-scene multiplier. */
.prepare-panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.85rem;
}

.prepare-heading-main {
  display: grid;
  justify-items: start;
  gap: 0.42rem;
}

.prepare-heading-main .form-hint {
  max-width: 42rem;
}

.prepare-heading-main .game-panel-actions {
  justify-content: flex-start;
}

.prepare-heading-side {
  align-self: start;
}

.prepare-top-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(3.9rem, auto));
  gap: 0;
  padding: 0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.78rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #182126, #2a1835 58%, #171b1f);
  color: #fff;
  box-shadow: 0 0.8rem 1.55rem rgba(17, 24, 39, 0.22);
  overflow: hidden;
}

.prepare-top-stats span {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  display: grid;
  gap: 0.08rem;
  line-height: 1;
  padding: 0.34rem 0.52rem;
}

.prepare-top-stats span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.prepare-top-stats small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.prepare-top-stats strong {
  color: #fff;
  font-size: 1.08rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0.18rem 0.6rem rgba(184, 30, 215, 0.45);
}

.prepare-game-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  padding: 0.36rem 0.42rem;
  border: 1px solid rgba(24, 32, 31, 0.12);
  border-radius: 0.78rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.66)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 0.55rem 1.25rem rgba(17, 24, 39, 0.08);
}

.prepare-game-hud span {
  display: grid;
  min-height: 0;
  gap: 0.08rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.14rem 0.5rem;
  text-transform: uppercase;
}

.prepare-game-hud span + span {
  border-left: 1px solid rgba(24, 32, 31, 0.12);
}

.prepare-game-hud small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0;
}

.prepare-game-hud strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1;
}

.prepare-stage {
  position: relative;
  overflow: hidden;
}

.prepare-stage-multiplier {
  position: absolute;
  z-index: 5;
  top: 0.52rem;
  right: 0.52rem;
  display: grid;
  min-width: 3rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(135deg, #20262b, #111827);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 1000;
  line-height: 1;
  padding: 0.42rem 0.62rem;
  pointer-events: none;
  text-shadow: 0 0.12rem 0.35rem rgba(0, 0, 0, 0.45);
  box-shadow: 0 0.6rem 1.25rem rgba(17, 24, 39, 0.28);
}

.prepare-stage-multiplier.is-hot {
  border-color: rgba(255, 222, 89, 0.56);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.56), transparent 34%),
    linear-gradient(135deg, #ffd35a, #b81ed7 58%, #241331);
}

.prepare-stage-multiplier.is-bumped {
  animation: prepareMultiplierBump 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes prepareMultiplierBump {
  0% {
    transform: scale(0.9);
  }
  42% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

.prepare-workbench {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.prepare-tool-card {
  min-width: 0;
  overflow: hidden;
}

.prepare-tool-visual.prepare-tool-image {
  contain: paint;
  max-width: 100%;
  overflow: hidden;
}

.prepare-tool-visual.prepare-tool-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prepare-tool-box img {
  transform: scale(0.88);
  transform-origin: center;
}

.prepare-box-preview,
.prepare-box-art {
  overflow: hidden;
}

.prepare-inventory {
  position: relative;
  z-index: 2;
}

@media (max-width: 760px) {
  .prepare-panel-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.42rem;
  }

  .prepare-heading-main {
    gap: 0.34rem;
  }

  .prepare-heading-main .game-panel-actions {
    gap: 0.34rem;
  }

  .prepare-top-stats {
    grid-template-columns: repeat(2, minmax(2.85rem, auto));
    border-radius: 0.66rem;
  }

  .prepare-top-stats span {
    padding: 0.28rem 0.36rem;
  }

  .prepare-top-stats small {
    font-size: 0.48rem;
  }

  .prepare-top-stats strong {
    font-size: 0.88rem;
  }

  .prepare-game-hud {
    padding: 0.28rem 0.24rem;
    border-radius: 0.64rem;
  }

  .prepare-game-hud span {
    padding: 0.1rem 0.34rem;
  }

  .prepare-game-hud small {
    font-size: 0.48rem;
  }

  .prepare-game-hud strong {
    font-size: 0.84rem;
  }

  .prepare-stage-multiplier {
    top: 0.38rem;
    right: 0.38rem;
    min-width: 2.58rem;
    font-size: 0.78rem;
    padding: 0.32rem 0.48rem;
  }

  .prepare-tool-box img {
    transform: scale(0.82);
  }
}
