:root {
  --text: rgba(248, 250, 255, 0.96);
  --text-dim: rgba(217, 224, 241, 0.72);
  --glass-bg: rgba(102, 119, 156, 0.25);
  --glass-border: rgba(214, 225, 255, 0.34);
  --glass-strong: rgba(64, 76, 108, 0.62);
  --blue: #55c4ff;
  --green: #2fd65c;
  --purple: #bc63ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f2f2f2 0%, #e8e8ea 100%);
}

.page-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.miniapp-wrap {
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
}

.miniapp-top {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  padding: 14px 14px 10px;
  gap: 8px;
}

.miniapp-top h1 {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.top-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.72);
  font-size: 20px;
  color: #222;
}

.top-spacer {
  width: 46px;
  height: 46px;
}

.phone-ui {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: 30px 30px 0 0;
  border: 1px solid rgba(163, 181, 223, 0.3);
}

.bg-layer {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 95% at 0% 96%, rgba(71, 20, 98, 0.88) 0%, transparent 55%),
    radial-gradient(95% 95% at 100% 5%, rgba(7, 68, 119, 0.78) 0%, transparent 58%),
    radial-gradient(90% 90% at 55% 82%, rgba(30, 88, 76, 0.64) 0%, transparent 62%),
    linear-gradient(120deg, #19184a 0%, #082f55 100%);
}

.island-row,
.status-row,
.chat-head,
.chat-scroll {
  position: relative;
  z-index: 2;
}

.island-row {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.island {
  width: 128px;
  height: 40px;
  border-radius: 22px;
  background: #070708;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2d3136;
}

.dot.live {
  background: #20d96a;
  box-shadow: 0 0 10px rgba(32, 217, 106, 0.8);
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 16px 8px;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.bars i {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: rgba(248, 250, 255, 0.9);
}

.bars i:nth-child(1) { height: 7px; }
.bars i:nth-child(2) { height: 12px; }
.bars i:nth-child(3) { height: 16px; }
.bars i:nth-child(4) { height: 20px; }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 8px 18px rgba(5, 9, 24, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.chat-head {
  margin: 0 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: rgba(44, 66, 108, 0.62);
}

.back-btn,
.menu-btn {
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
}

.bot-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #95bfff 0%, #8672f8 68%, #6b4de4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.bot-meta h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.bot-meta p {
  margin: 2px 0 0;
  color: var(--green);
  font-size: 12px;
}

.menu-btn {
  margin-left: auto;
  font-size: 18px;
}

.chat-scroll {
  height: calc(100vh - 176px);
  overflow-y: auto;
  padding: 10px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-scroll::-webkit-scrollbar {
  display: none;
}

.date-pill {
  align-self: center;
  font-size: 12px;
  color: rgba(216, 227, 248, 0.88);
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(92, 106, 140, 0.45);
  border: 1px solid rgba(198, 212, 243, 0.22);
}

.welcome-card {
  padding: 20px;
  text-align: center;
}

.welcome-card .emoji {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.welcome-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.welcome-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.35;
}

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

.cat-card {
  border-radius: 22px;
  border: 1px solid transparent;
  background: rgba(73, 87, 121, 0.25);
  color: var(--text);
  text-align: left;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-card .icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.cat-card .cat-icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(8, 12, 26, 0.45));
}

.cat-card .cat-icon-emoji {
  font-size: 24px;
  line-height: 1;
}

.cat-card .name {
  font-size: 14px;
  font-weight: 600;
}

.cat-card .count {
  font-size: 12px;
  color: rgba(221, 229, 244, 0.78);
}

.cat-card.accent1 { border-color: rgba(92, 194, 255, 0.6); background: rgba(67, 120, 180, 0.2); }
.cat-card.accent2 { border-color: rgba(202, 114, 255, 0.6); background: rgba(128, 77, 165, 0.18); }
.cat-card.accent3 { border-color: rgba(55, 209, 130, 0.58); background: rgba(53, 120, 102, 0.18); }
.cat-card.accent4 { border-color: rgba(255, 184, 68, 0.56); background: rgba(126, 109, 65, 0.2); }

.hits-card {
  padding: 10px;
}

.hits-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 2px 4px;
}

.hits-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  color: #e6ecff;
  border: 1px solid rgba(201, 216, 255, 0.55);
  border-radius: 999px;
  padding: 6px 12px;
  background: linear-gradient(130deg, rgba(110, 159, 215, 0.45), rgba(151, 118, 217, 0.45));
}

.product-card {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(222, 232, 255, 0.34);
  border-radius: 18px;
  background: var(--glass-strong);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.product-emoji {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(211, 219, 240, 0.22);
  border: 1px solid rgba(234, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.product-main {
  min-width: 0;
  flex: 1;
}

.product-main .name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.product-main .sub {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  margin-left: auto;
  color: var(--green);
  font-size: 16px;
  font-weight: 700;
}

.keyboard {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  gap: 8px;
}

.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
.row.one { grid-template-columns: 1fr; }

.kb {
  border-radius: 999px;
  border: 1px solid rgba(221, 231, 252, 0.35);
  padding: 11px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: rgba(85, 97, 131, 0.38);
}

.kb.primary { background: linear-gradient(120deg, rgba(73, 139, 205, 0.44), rgba(78, 113, 181, 0.4)); color: var(--blue); }
.kb.success { background: linear-gradient(120deg, rgba(56, 123, 91, 0.48), rgba(56, 151, 89, 0.4)); color: #34d066; }
.kb.purple { background: linear-gradient(120deg, rgba(118, 66, 170, 0.5), rgba(150, 82, 172, 0.42)); color: var(--purple); }

.feed-msg {
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
}

.feed-msg .title {
  font-weight: 600;
  margin-bottom: 4px;
}

.feed-msg.success .title { color: var(--green); }
.feed-msg.warn .title { color: #ffb0ba; }

@media (max-width: 430px) {
  .chat-scroll {
    height: calc(100vh - 170px);
  }
}

.cat-card.active {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.product-card {
  cursor: pointer;
}

.product-price {
  margin-left: auto;
  padding-right: 6px;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-btn {
  border: 1px solid rgba(225, 235, 255, 0.4);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #eef4ff;
  font-size: 12px;
  font-weight: 700;
  min-width: 42px;
  height: 28px;
}

.mini-btn:active {
  transform: scale(0.96);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(3, 8, 20, 0.58);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 16px;
}

.sheet-backdrop.hidden {
  display: none;
}

.sheet {
  width: min(430px, 100%);
  max-height: min(84vh, 760px);
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(229, 238, 255, 0.35);
  background: rgba(33, 45, 74, 0.9);
  backdrop-filter: blur(22px);
  color: var(--text);
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.4);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(221, 231, 252, 0.2);
}

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

.sheet-close {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 8px;
  width: 32px;
  height: 32px;
}

.sheet-body {
  overflow-y: auto;
  max-height: min(74vh, 680px);
  padding: 12px;
}

.sheet-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-dim);
}

.cart-list,
.order-list,
.fav-list {
  display: grid;
  gap: 10px;
}

.cart-row,
.order-row,
.fav-row {
  border: 1px solid rgba(224, 233, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px;
}

.cart-row {
  display: grid;
  gap: 8px;
}

.cart-name,
.fav-name {
  font-weight: 700;
  color: var(--text);
}

.cart-sub,
.order-sub,
.fav-sub {
  color: var(--text-dim);
  font-size: 12px;
}

.cart-line {
  color: var(--text);
  font-size: 12px;
  margin-top: 4px;
}

.qty-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  border: 1px solid rgba(216, 228, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  font-weight: 700;
}

.qty-btn.danger {
  width: auto;
  padding: 0 8px;
}

.cart-total {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}

.order-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(216, 227, 248, 0.18);
  display: grid;
  gap: 8px;
}

.order-form h4 {
  margin: 0;
}

.sheet-input {
  width: 100%;
  border: 1px solid rgba(216, 227, 248, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 16px;
}

.sheet-input::placeholder {
  color: var(--text-dim);
}

.admin-upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.admin-upload-row .sheet-input {
  min-height: 40px;
  font-size: 13px;
}

.sheet-btn {
  border: 1px solid rgba(216, 227, 248, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.sheet-btn.primary {
  background: linear-gradient(130deg, rgba(66, 151, 232, 0.65), rgba(105, 99, 221, 0.6));
}

.search-box {
  display: grid;
  gap: 8px;
}

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

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 4px;
}

.order-preview {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.fav-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.fav-price {
  color: var(--green);
  font-weight: 700;
  margin-bottom: 6px;
  text-align: right;
}

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

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(216, 227, 248, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
}

.profile-row span {
  color: var(--text-dim);
}

.profile-row strong {
  color: var(--text);
}

.sheet-note {
  color: var(--text-dim);
  font-size: 12px;
}

.sheet-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.sheet-divider {
  height: 1px;
  margin: 12px 0;
  background: rgba(216, 227, 248, 0.2);
}

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

.action-btn {
  min-height: 42px;
}

.sheet-btn.danger {
  border-color: rgba(255, 123, 143, 0.35);
  background: rgba(255, 96, 122, 0.14);
}

.sheet-btn.tiny {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 8px;
}

.promo-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(216, 227, 248, 0.18);
}

.promo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.promo-status {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.promo-status.ok {
  color: #39dd6e;
}

.promo-status.warn {
  color: #ffb0ba;
}

.bonus-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(216, 227, 248, 0.18);
}

.loyalty-hero {
  border: 1px solid rgba(216, 227, 248, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
}

.loyalty-points {
  font-size: 26px;
  font-weight: 800;
  color: #f3f7ff;
}

.loyalty-sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

.progress-track {
  margin-top: 10px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #30d158, #5ac8fa);
}

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

.tx-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(216, 227, 248, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 9px 10px;
  font-size: 13px;
}

.ref-grid {
  display: grid;
  gap: 10px;
}

.ref-box {
  border: 1px solid rgba(216, 227, 248, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
}

.ref-code {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 6px 0 8px;
}

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

.ref-stats {
  border: 1px solid rgba(216, 227, 248, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

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

.ref-row {
  border: 1px solid rgba(216, 227, 248, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ref-name {
  font-weight: 700;
}

.ref-sub,
.ref-date {
  font-size: 12px;
  color: var(--text-dim);
}

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

.promo-card,
.promo-code-row {
  border: 1px solid rgba(216, 227, 248, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
}

.promo-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.promo-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}

.promo-code-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.promo-code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.promo-actions {
  display: grid;
  gap: 6px;
  min-width: 104px;
}

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

.address-row {
  border: 1px solid rgba(216, 227, 248, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.address-name {
  font-size: 13px;
  font-weight: 700;
}

.address-sub {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 12px;
}

.address-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.default-chip {
  display: inline-block;
  border: 1px solid rgba(48, 209, 88, 0.4);
  background: rgba(48, 209, 88, 0.16);
  color: #66eb8c;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.settings-grid {
  display: grid;
  gap: 8px;
}

.info-card {
  display: grid;
  gap: 6px;
}

.info-text {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

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

.review-row,
.review-eligible-row {
  border: 1px solid rgba(216, 227, 248, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
}

.review-eligible-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.review-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.review-title {
  font-size: 13px;
  font-weight: 700;
}

.review-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-dim);
}

.review-text {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
}

.review-photo-preview {
  margin-top: 8px;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(212, 226, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
}

.review-form {
  display: grid;
  gap: 8px;
}

.review-bonus-note {
  font-size: 12px;
  color: #ffcfde;
  line-height: 1.35;
}

.review-photo-wrap {
  display: grid;
  gap: 6px;
}

.review-photo-input {
  display: none;
}

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

.review-photo-clear:disabled {
  opacity: 0.45;
}

.review-photo-name {
  min-height: 16px;
}

.admin-tools {
  display: grid;
  gap: 8px;
}

.admin-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  max-height: 54vh;
  overflow-y: auto;
  padding-right: 2px;
}

.admin-row {
  border: 1px solid rgba(216, 227, 248, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-icon-grid {
  display: grid;
  gap: 8px;
}

.admin-icon-row {
  display: grid;
  gap: 6px;
}

.admin-icon-label {
  font-size: 12px;
  color: var(--text-dim);
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.admin-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.product-card.out-of-stock {
  border-color: rgba(255, 176, 186, 0.42);
  background: rgba(110, 82, 98, 0.34);
}

.stock-ok {
  color: #7ff0a3;
}

.stock-out {
  color: #ffb0ba;
}

.alt-row {
  border: 1px solid rgba(216, 227, 248, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.model-card .product-actions {
  justify-content: center;
}

.model-open-btn {
  min-width: 74px;
}

.model-back-btn {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(220, 231, 255, 0.38);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
}

.model-back-btn:active {
  transform: scale(0.98);
}

:root {
  --tg-viewport-height: 100vh;
}

html,
body {
  height: 100%;
}

body.tg-webapp {
  overflow: hidden;
  background: #060914;
}

body.tg-webapp .page-shell {
  min-height: var(--tg-viewport-height);
  height: var(--tg-viewport-height);
  justify-content: stretch;
}

body.tg-webapp .miniapp-wrap {
  width: 100vw;
  min-height: var(--tg-viewport-height);
  max-width: none;
}

body.tg-webapp .miniapp-top {
  display: none;
}

body.tg-webapp .phone-ui {
  border: none;
  border-radius: 0;
  min-height: var(--tg-viewport-height);
  padding-top: env(safe-area-inset-top);
}

body.tg-webapp .chat-scroll {
  height: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

body.tg-webapp .sheet-backdrop {
  padding: 0;
}

body.tg-webapp .sheet {
  width: 100%;
  max-height: var(--tg-viewport-height);
  border-radius: 22px 22px 0 0;
}

/* ==========================================================================
   Storefront redesign
   ========================================================================== */

:root {
  --sf-bg: #e9edf6;
  --sf-ink: #0f1a33;
  --sf-muted: #607096;
  --sf-glass: rgba(255, 255, 255, 0.58);
  --sf-border: rgba(165, 182, 221, 0.48);
  --sf-shadow: 0 12px 28px rgba(14, 29, 67, 0.16);
  --sf-accent: #1f86ff;
}

html,
body {
  background:
    radial-gradient(120% 120% at -5% -10%, #f7fbff 0%, transparent 55%),
    radial-gradient(100% 90% at 110% 120%, #dce7ff 0%, transparent 60%),
    var(--sf-bg);
}

.page-shell {
  align-items: stretch;
}

.miniapp-wrap {
  width: min(460px, 100vw);
}

.miniapp-top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 12px 10px;
  background: linear-gradient(180deg, rgba(233, 237, 246, 0.95), rgba(233, 237, 246, 0.6));
  backdrop-filter: blur(10px);
}

.miniapp-top h1 {
  font-size: 17px;
  letter-spacing: 0.2px;
}

.top-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(173, 186, 221, 0.6);
  background: rgba(255, 255, 255, 0.72);
}

.top-spacer {
  width: 44px;
  height: 44px;
}

.phone-ui.storefront-ui {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 68px);
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(158, 177, 219, 0.44);
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.3), 0 26px 48px rgba(17, 35, 78, 0.28);
}

.bg-layer {
  background:
    radial-gradient(120% 120% at 5% 95%, rgba(43, 25, 111, 0.9) 0%, transparent 58%),
    radial-gradient(100% 100% at 95% 5%, rgba(8, 80, 138, 0.78) 0%, transparent 62%),
    radial-gradient(90% 80% at 65% 80%, rgba(18, 123, 96, 0.54) 0%, transparent 64%),
    linear-gradient(128deg, #171c53 0%, #0a395f 100%);
}

.chat-head {
  margin: 12px 12px 8px;
  border-radius: 16px;
  border: 1px solid rgba(201, 216, 250, 0.28);
  background: rgba(35, 55, 95, 0.6);
}

.back-btn,
.menu-btn {
  color: #7ad2ff;
  font-size: 14px;
}

.bot-avatar {
  width: 48px;
  height: 48px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 6px 18px rgba(57, 111, 190, 0.3);
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  height: auto;
  padding: 10px 12px 98px;
  gap: 12px;
}

.date-pill {
  display: none;
}

.storefront-hero {
  border-radius: 22px;
  padding: 18px;
  text-align: left;
  background: rgba(66, 99, 163, 0.28);
}

.storefront-hero .emoji {
  font-size: 26px;
  margin-bottom: 10px;
}

.storefront-hero h3 {
  font-size: 28px;
  line-height: 1.04;
  margin: 0 0 10px;
  text-shadow: 0 3px 10px rgba(7, 15, 35, 0.32);
}

.storefront-hero p {
  font-size: 14px;
  line-height: 1.4;
  color: rgba(233, 240, 255, 0.86);
}

.quick-actions {
  padding: 10px;
  display: grid;
  gap: 8px;
  border-radius: 18px;
}

.quick-actions .row {
  display: grid;
  gap: 8px;
}

.quick-actions .row.two {
  grid-template-columns: 1fr 1fr;
}

.quick-actions .row.one {
  grid-template-columns: 1fr;
}

.quick-actions .row.one .quick-btn {
  text-align: center;
  justify-content: center;
}

.quick-btn {
  border-radius: 14px;
  border: 1px solid rgba(214, 227, 255, 0.38);
  background: rgba(83, 101, 144, 0.42);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-btn:active {
  transform: translateY(1px);
}

.section-block {
  display: grid;
  gap: 10px;
}

.breadcrumbs-wrap {
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(66, 84, 126, 0.4);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 20px;
}

.crumb-sep {
  color: rgba(214, 226, 251, 0.55);
  font-size: 12px;
}

.crumb-btn,
.crumb-current {
  font-size: 12px;
  line-height: 1.2;
  border-radius: 999px;
  padding: 4px 8px;
}

.crumb-btn {
  border: 1px solid rgba(206, 220, 255, 0.34);
  background: rgba(113, 132, 180, 0.26);
  color: #dce7ff;
}

.crumb-current {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(241, 246, 255, 0.95);
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-line h4 {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 16px;
  color: rgba(229, 238, 255, 0.93);
  letter-spacing: 0.2px;
}

.small-link {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: #d8ecff;
}

.category-grid {
  gap: 10px;
}

.cat-card {
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 8px 16px rgba(11, 23, 54, 0.22);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
  overflow: hidden;
  min-height: 190px;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
}

.cat-card:active {
  transform: scale(0.98);
}

.cat-card .cat-media {
  width: 100%;
  min-height: 130px;
  border-radius: 16px;
  border: 1px solid rgba(222, 235, 255, 0.32);
  background: rgba(245, 249, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.cat-card .cat-icon-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(10, 20, 45, 0.35));
}

.cat-card .cat-icon-emoji {
  font-size: 72px;
  line-height: 1;
}

.cat-card .name {
  font-size: 17px;
  line-height: 1.2;
}

.storefront-catalog {
  border-radius: 20px;
  padding: 10px;
  background: rgba(72, 88, 124, 0.4);
}

.hits-head {
  margin-bottom: 8px;
}

.hits-head h4 {
  font-size: 18px;
}

.badge {
  background: linear-gradient(125deg, rgba(102, 171, 237, 0.56), rgba(155, 124, 232, 0.5));
}

.product-card {
  border-radius: 16px;
  padding: 11px;
  background: rgba(85, 99, 131, 0.62);
}

.product-main .name {
  font-size: 15px;
}

.product-main .sub {
  font-size: 12px;
}

.product-price {
  font-size: 18px;
}

.qty-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(218, 230, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  padding: 2px;
}

.qty-mini .qty-mini-btn {
  min-width: 28px;
  height: 26px;
  border-radius: 8px;
  font-size: 14px;
}

.qty-mini .qty-mini-btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.qty-mini-value {
  min-width: 22px;
  text-align: center;
  color: #eef4ff;
  font-size: 12px;
  font-weight: 700;
}

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

.models-grid .catalog-stage {
  grid-column: 1 / -1;
}

.models-grid .model-card {
  margin-top: 0;
}

.model-card {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 10px;
}

.model-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid rgba(226, 236, 255, 0.34);
  background: rgba(203, 217, 245, 0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.model-fallback-emoji {
  font-size: 30px;
  line-height: 1;
}

.model-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.model-sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.3;
  min-height: 30px;
}

.model-price {
  font-size: 14px;
  font-weight: 700;
  color: #8cf6b5;
}

.model-open-btn {
  width: 100%;
  min-width: 0;
  height: 32px;
}

.admin-top-model-list {
  max-height: 50vh;
  overflow: auto;
  padding-right: 4px;
}

.admin-top-model-row {
  align-items: flex-start;
}

.admin-top-model-row span {
  line-height: 1.35;
}

.admin-model-image-grid {
  display: grid;
  gap: 10px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 4px;
}

.admin-model-image-row {
  border: 1px solid rgba(198, 215, 255, 0.25);
  border-radius: 14px;
  background: rgba(85, 101, 136, 0.45);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.admin-model-image-title {
  font-size: 15px;
  font-weight: 700;
  color: #eef5ff;
}

.admin-model-image-sub {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(220, 232, 255, 0.82);
}

.section-block.is-hidden,
.storefront-catalog.is-hidden {
  display: none;
}

.breadcrumbs-wrap.is-hidden {
  display: none;
}

.catalog-stage {
  border-radius: 16px;
  padding: 10px;
  background: rgba(88, 106, 147, 0.52);
  border: 1px solid rgba(219, 232, 255, 0.35);
  margin-bottom: 8px;
}

.stage-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.stage-nav-btn {
  border: 1px solid rgba(214, 227, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e6f2ff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

.stage-nav-btn.primary {
  background: rgba(75, 154, 244, 0.32);
  border-color: rgba(141, 206, 255, 0.55);
}

.stage-copy .stage-title {
  font-size: 15px;
  color: #f1f7ff;
  font-weight: 700;
}

.stage-copy .stage-sub {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(223, 233, 251, 0.85);
}

.stage-model-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stage-model-media {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  border: 1px solid rgba(221, 233, 255, 0.36);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.stage-model-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-model-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-model-copy strong {
  color: #f3f8ff;
  font-size: 17px;
  line-height: 1.2;
}

.stage-model-copy small {
  color: rgba(220, 231, 251, 0.78);
  font-size: 12px;
}

.stage-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 8px;
}

.stage-chip {
  border-radius: 999px;
  border: 1px solid rgba(212, 226, 255, 0.32);
  background: rgba(255, 255, 255, 0.09);
  color: rgba(236, 244, 255, 0.95);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
}

.stage-chip.stage-chip-price {
  font-size: 14px;
  font-weight: 800;
  color: #36e87c;
  border-color: rgba(90, 234, 151, 0.45);
  background: rgba(30, 95, 67, 0.35);
  padding: 6px 12px;
}

.feed-msg {
  border-radius: 14px;
  background: rgba(74, 92, 132, 0.42);
}

.bottom-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 3;
  display: grid;
  gap: 8px;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border-radius: 14px;
  padding: 6px;
  background: rgba(53, 73, 119, 0.62);
}

.tab-btn {
  border: 1px solid rgba(198, 215, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(222, 234, 255, 0.88);
  font-size: 11px;
  font-weight: 700;
  min-height: 36px;
  padding: 6px 6px;
}

.tab-btn.active {
  border-color: rgba(141, 203, 255, 0.6);
  background: rgba(71, 151, 225, 0.34);
  color: #eaf7ff;
}

.cart-cta {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(149, 210, 255, 0.5);
  background: linear-gradient(115deg, rgba(48, 125, 212, 0.82), rgba(76, 176, 255, 0.75));
  color: #f2fbff;
  font-weight: 800;
  font-size: 15px;
  padding: 14px 14px;
  box-shadow: 0 14px 28px rgba(12, 66, 124, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.cart-cta:active {
  transform: translateY(1px);
}

body.tg-webapp .page-shell {
  min-height: var(--tg-viewport-height);
  height: var(--tg-viewport-height);
}

body.tg-webapp .miniapp-wrap {
  width: 100vw;
  max-width: none;
  min-height: var(--tg-viewport-height);
}

body.tg-webapp .miniapp-top {
  display: none;
}

body.tg-webapp .phone-ui.storefront-ui {
  border: 0;
  border-radius: 0;
  min-height: var(--tg-viewport-height);
  padding-top: 0;
}

body.tg-webapp .chat-scroll {
  padding-top: calc(env(safe-area-inset-top) + 76px);
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
}

@media (max-width: 430px) {
  .storefront-hero h3 {
    font-size: 23px;
  }

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

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