* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #120722;
}

body {
  position: fixed;
  inset: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
  -webkit-user-select: none;
  user-select: none;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: #120722;
}

.loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.82);
  background: #120722;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-mark {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.screen-track {
  position: absolute;
  inset: 0;
  display: flex;
  width: auto;
  transform: translate3d(-200vw, 0, 0);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.screen {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  padding: 22px 16px calc(112px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen-head {
  margin-bottom: 18px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
}

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

.panel {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
}

.panel + .panel {
  margin-top: 12px;
}

.panel.compact {
  padding: 14px;
}

.profile-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 13px;
  align-items: center;
}

.avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 800;
  font-size: 22px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.muted {
  color: rgba(255, 255, 255, 0.62);
}

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

.stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.stat b {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

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

.product-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  color: #ffffff;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16);
}

.product-row-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-row-price {
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
}

.product-media img,
.product-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-card .product-media {
  max-height: 56vh;
  border-radius: 20px;
  background: #08030e;
}

.modal-card .product-media.is-portrait {
  width: min(100%, 36vh);
  margin-inline: auto;
  max-height: 58vh;
}

.modal-card .product-media img,
.modal-card .product-media video {
  object-fit: contain;
}

.modal-card .product-media video {
  pointer-events: auto;
  touch-action: manipulation;
}

.video-shell {
  user-select: none;
}

.video-shell video {
  display: block;
}

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.48);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  font-size: 24px;
  font-weight: 900;
  transform: translate3d(-50%, -50%, 0);
}

.video-play.is-playing {
  opacity: 0;
  pointer-events: none;
}

.video-time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 5px 8px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.product-title {
  margin: 14px 0 7px;
  font-size: 22px;
}

.product-desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.4;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.price {
  font-size: 22px;
  font-weight: 900;
}

button,
textarea,
input {
  font: inherit;
}

.buy-button,
.primary-action,
.open-order-card {
  min-height: 48px;
  padding: 0 18px;
  color: #16051f;
  background: #ffffff;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.open-order-card {
  width: 100%;
  min-height: 68px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
}

.order-form {
  display: grid;
  gap: 13px;
}

.order-form label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: none;
  padding: 13px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  outline: none;
  background: rgba(0, 0, 0, 0.22);
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.empty {
  padding: 18px;
  color: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.history-list,
.plain-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li,
.plain-list li {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.copy-link {
  overflow-wrap: anywhere;
  color: #ffffff;
}

.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  align-items: end;
}

.modal-layer[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  width: min(100%, 520px);
  height: var(--sheet-height, min(68vh, 620px));
  max-height: calc(94vh - env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
  padding: 32px 16px 16px;
  overflow: auto;
  scrollbar-width: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px 26px 0 0;
  background: #1d0d30;
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.44);
  transition: height 240ms cubic-bezier(0.22, 1, 0.36, 1);
  animation: sheet-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: pan-y;
}

.modal-card::-webkit-scrollbar {
  display: none;
}

.modal-card.is-expanded {
  height: var(--sheet-height, calc(94vh - env(safe-area-inset-bottom, 0px)));
}

.modal-card.is-dragging {
  transition: none;
}

@keyframes sheet-in {
  from {
    transform: translate3d(0, 36px, 0);
    opacity: 0.5;
  }
}

.sheet-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 3;
  width: 54px;
  height: 18px;
  margin-left: -27px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.sheet-handle::before {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 7px;
  height: 4px;
  content: "";
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.sheet-handle:active {
  cursor: grabbing;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 2;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-close::before,
.modal-close::after {
  position: absolute;
  left: 10px;
  top: 18px;
  width: 18px;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.72));
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  z-index: 14;
  padding: 13px 15px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 12px, 0);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.bottom-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: clamp(96px, 18vh, 142px);
  overflow: visible;
  touch-action: none;
  pointer-events: none;
}

.icon-carousel {
  position: absolute;
  inset-inline: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  height: 66px;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}

.icon-carousel.is-dragging {
  cursor: grabbing;
}

.carousel-item {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 56px;
  margin: 0 0 0 -28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.carousel-item img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.42));
  transform: translateZ(0);
}

.carousel-item.is-active {
  background: transparent;
}
