/* ==========================================================================
   COZY SUPERMARKET – PANORAMIC 2.5D UI & COZY VIETNAMESE HUD (EDITION V5)
   Thiết kế đồng bộ 100% theo bộ 4 ảnh mẫu:
   - Tông kem sữa (#fff9ee), viền nâu caramel (#c8a987), nút bo tròn 3D bóng nhẹ
   - Bố cục HUD: Góc trên trái (Pause + Sao Cấp + Đánh giá + Mục tiêu tiếp theo),
     Cột trái 5 nút (Nhiệm vụ, Thư, Tủ kính, Mùa, Nhà tôi),
     Giữa trên (Ngày · Chuẩn bị + Mở), Phải trên (Tiền $ + Giấy ghim Hôm nay),
     Phải giữa (Hầm kho + Việc hôm nay), Đáy trái (Quầy + Đại lý sỉ), Đáy phải (Nhân viên + Sổ tay + Sắp xếp)
   ========================================================================== */

html:has(#sm-cozy-root),
body:has(#sm-cozy-root) {
  overflow: hidden !important;
  max-width: 100% !important;
  overscroll-behavior: none;
  background: #f5e6d3;
}

body:has(#sm-cozy-root) .portal-footer,
body:has(#sm-cozy-root) footer,
body:has(#sm-cozy-root) .floating-contact,
body:has(#sm-cozy-root) .portal-floating-social {
  display: none !important;
}

body:has(#sm-cozy-root) main,
body:has(#sm-cozy-root) .portal-main,
body:has(#sm-cozy-root) .portal-main-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
}

.sm-cozy-root,
.sm-cozy-root *,
.sm-cozy-root *::before,
.sm-cozy-root *::after {
  box-sizing: border-box;
}

.sm-cozy-root {
  --c-cream: #fff9ef;
  --c-cream-dark: #f5ead6;
  --c-border: #c5a888;
  --c-text: #432c1f;
  --c-muted: #7b6656;
  --c-mint: #5bb381;
  --c-coral: #e56b55;
  --c-gold: #f4b942;
  --c-sky: #65b2e8;
  --c-violet: #a78bfa;

  /* Vùng an toàn chuẩn cho tai thỏ / Dynamic Island / camera đục lỗ / thanh vuốt Home */
  --sm-safe-top: calc(env(safe-area-inset-top, 0px) + 12px);
  --sm-safe-right: calc(env(safe-area-inset-right, 0px) + 14px);
  --sm-safe-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  --sm-safe-left: calc(env(safe-area-inset-left, 0px) + 14px);

  position: relative;
  width: 100%;
  max-width: 100%;
  height: calc(100dvh - 68px);
  min-height: 520px;
  overflow: hidden;
  background: #fcd9c2;
  font-family: 'Plus Jakarta Sans', 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--c-text);
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sm-cozy-root button,
.sm-cozy-root select,
.sm-cozy-root input {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sm-cozy-root.is-fullscreen,
.sm-cozy-root:fullscreen,
.sm-cozy-root:-webkit-full-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  background: #fcd9c2 !important;
  z-index: 9999 !important;
}

/* Lớp giao diện đồng nhất 1 tỷ lệ chuẩn 1280x720 (co giãn mượt theo chiều cao thực tế, bất chấp thu phóng 50%-150%) */
.sm-ui-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}

.sm-ui-stage > :not(.sm-hud-topleft):not(.sm-hud-topright):not(.sm-toast-stack) {
  pointer-events: auto;
}

/* Chế độ toàn khung cho điện thoại / thiết bị cảm ứng: LUÔN ẩn header & sidebar web bất kể mức thu phóng Safari/Chrome! */
body.sm-mobile-immersive .portal-header,
body.sm-mobile-immersive .portal-topbar,
body.sm-mobile-immersive .portal-sidebar,
body.sm-mobile-immersive .portal-sidebar-backdrop,
body.sm-mobile-immersive .portal-mobile-search-panel,
body.sm-mobile-immersive header.site-header,
body.sm-mobile-immersive .navbar {
  display: none !important;
}

body.sm-mobile-immersive .portal-main-area,
body.sm-mobile-immersive .portal-layout,
body.sm-mobile-immersive .portal-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.sm-cozy-root.is-touch-device {
  --sm-safe-top: 14px;
  --sm-safe-right: 52px;
  --sm-safe-bottom: 16px;
  --sm-safe-left: 52px;

  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  z-index: 950;
}

.sm-cozy-root.is-touch-device.is-fullscreen,
.sm-cozy-root.is-touch-device:fullscreen,
.sm-cozy-root.is-touch-device:-webkit-full-screen {
  --sm-safe-top: 18px;
  --sm-safe-right: 74px;
  --sm-safe-bottom: 22px;
  --sm-safe-left: 74px;
}

.sm-hidden {
  display: none !important;
}

.sm-phaser-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

.sm-phaser-host:active {
  cursor: grabbing;
}

/* ==================== MÀN HÌNH YÊU CẦU XOAY NGANG MOBILE ==================== */
.sm-rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: radial-gradient(circle at 50% 35%, rgba(255, 249, 239, 0.96), rgba(244, 214, 188, 0.98));
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding:
    max(18px, calc(env(safe-area-inset-top, 0px) + 12px))
    max(18px, calc(env(safe-area-inset-right, 0px) + 14px))
    max(18px, calc(env(safe-area-inset-bottom, 0px) + 12px))
    max(18px, calc(env(safe-area-inset-left, 0px) + 14px));
}

.sm-rotate-overlay.is-active {
  display: flex;
}

.sm-rotate-card {
  width: 100%;
  max-width: 360px;
  background: var(--c-cream);
  border: 3px solid #d4a373;
  border-radius: 26px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 44px rgba(67, 44, 31, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sm-rotate-phone {
  font-size: 3.1rem;
  line-height: 1;
  display: inline-block;
  animation: sm-phone-tilt 2.2s ease-in-out infinite;
}

@keyframes sm-phone-tilt {
  0%, 15% { transform: rotate(0deg); }
  45%, 70% { transform: rotate(-90deg); }
  90%, 100% { transform: rotate(0deg); }
}

.sm-rotate-card h2 {
  margin: 4px 0 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--c-text);
}

.sm-rotate-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--c-muted);
  line-height: 1.45;
}

.sm-rotate-card small {
  font-size: 0.72rem;
  color: #92400e;
  font-weight: 700;
  line-height: 1.35;
}

/* ==================== MÀN HÌNH BẮT ĐẦU & TÀI KHOẢN ==================== */
.sm-start-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: radial-gradient(circle at 50% 35%, rgba(255, 249, 239, 0.94), rgba(244, 214, 188, 0.97));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sm-safe-top) var(--sm-safe-right) var(--sm-safe-bottom) var(--sm-safe-left);
}

.sm-start-card {
  width: 460px;
  max-width: 100%;
  background: var(--c-cream);
  border: 3.5px solid #d4a373;
  border-radius: 30px;
  padding: 26px 24px;
  box-shadow: 0 22px 50px rgba(67, 44, 31, 0.24), inset 0 2px 0 #ffffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sm-start-emblem {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: linear-gradient(180deg, #dcfce7, #a7f3d0);
  border: 3px solid #5bb381;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  box-shadow: 0 6px 0 rgba(91, 179, 129, 0.25);
}

.sm-start-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1.5px solid #86efac;
  color: #166534;
}

.sm-start-badge.is-guest {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.sm-start-title {
  margin: 2px 0 0;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

.sm-start-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--c-muted);
  line-height: 1.45;
}

.sm-save-summary {
  width: 100%;
  background: #ffffff;
  border: 2px solid #e6d5be;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.sm-start-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.sm-start-subrow {
  display: flex;
  gap: 8px;
}

.sm-big-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 16px;
  border: 2.5px solid rgba(67, 44, 31, 0.2);
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}

.sm-big-btn:hover:not(:disabled) {
  filter: brightness(1.04);
}

.sm-big-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.sm-big-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sm-big-btn.is-continue {
  background: linear-gradient(180deg, #68c98c, #49a86d);
  color: #ffffff;
  border-color: #347d50;
  box-shadow: 0 4px 0 #347d50;
}

.sm-big-btn.is-new {
  background: linear-gradient(180deg, #ffd166, #f4a938);
  color: #4a2c11;
  border-color: #c27d1a;
  box-shadow: 0 4px 0 #c27d1a;
}

.sm-big-btn.is-outline {
  background: #ffffff;
  color: var(--c-text);
  border-color: #d6c4ae;
  font-size: 0.8rem;
  padding: 10px 12px;
}

.sm-big-btn.is-danger {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fda4af;
  font-size: 0.8rem;
  padding: 10px 12px;
}

.sm-confirm-box {
  width: 100%;
  background: #fff1f2;
  border: 2px solid #fda4af;
  border-radius: 16px;
  padding: 12px;
  font-size: 0.81rem;
}

.sm-confirm-btns {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

/* ==================== GÓC TRÊN TRÁI (PAUSE + SAO CẤP ĐỘ + MỤC TIÊU TIẾP THEO) ==================== */
.sm-hud-topleft {
  position: absolute;
  top: var(--sm-safe-top);
  left: var(--sm-safe-left);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.sm-hud-topleft > * {
  pointer-events: auto;
}

.sm-tl-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-pause-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2.8px solid #2b5b84;
  background: linear-gradient(180deg, #68b5e8, #3d8ac4);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(43, 91, 132, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sm-lv-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--c-cream);
  border: 2.5px solid var(--c-border);
  border-radius: 999px;
  padding: 5px 13px 5px 7px;
  box-shadow: 0 5px 14px rgba(67, 44, 31, 0.14);
}

.sm-star-lv {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: linear-gradient(180deg, #fde047, #f59e0b);
  border: 2px solid #b45309;
  color: #451a03;
  font-size: 0.9rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  transform: rotate(-6deg);
}

.sm-exp-track {
  width: 68px;
  height: 12px;
  border-radius: 999px;
  background: #e2d8c9;
  border: 1.5px solid #bfa98e;
  overflow: hidden;
}

.sm-exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #84cc16, #4ade80);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.sm-rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.88rem;
  color: var(--c-text);
}

.sm-clean-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1.8px solid #86efac;
  background: #ecfdf5;
  color: #047857;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  white-space: nowrap;
}
.sm-clean-chip:active { transform: scale(0.95); }
.sm-clean-chip.is-warn {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #b45309;
  animation: smCleanPulse 1.6s ease-in-out infinite;
}
.sm-clean-chip.is-dirty {
  background: #fff1f2;
  border-color: #fb7185;
  color: #be123c;
  animation: smCleanPulse 1.1s ease-in-out infinite;
}
@keyframes smCleanPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Thanh Mục tiêu tiếp theo (Giấy phép Đồ hộp $260 / $260) */
.sm-next-goal-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 245px;
  background: rgba(255, 249, 239, 0.96);
  border: 2.5px solid var(--c-border);
  border-radius: 18px;
  padding: 6px 11px;
  box-shadow: 0 5px 14px rgba(67, 44, 31, 0.12);
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s;
}

.sm-next-goal-pill:hover {
  transform: translateY(-1px);
}

.sm-next-goal-pill.is-ready {
  border-color: #16a34a;
  background: #f0fdf4;
}

.sm-goal-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.sm-goal-info {
  flex: 1;
  min-width: 0;
}

.sm-goal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--c-muted);
}

.sm-goal-top strong {
  color: var(--c-text);
  font-weight: 800;
}

.sm-goal-name {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 1px 0 3px;
}

.sm-goal-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e7dccb;
  overflow: hidden;
}

.sm-goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* ==================== CỘT 5 NÚT DỌC BÊN TRÁI (NHIỆM VỤ / THƯ / TỦ KÍNH / MÙA / NHÀ TÔI) ==================== */
.sm-left-rail {
  position: absolute;
  top: calc(var(--sm-safe-top) + 118px);
  left: var(--sm-safe-left);
  z-index: 28;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sm-rail-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 17px;
  border: 2.5px solid rgba(67, 44, 31, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  color: #ffffff;
  box-shadow: 0 4px 0 rgba(67, 44, 31, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.38);
  transition: transform 0.12s;
}

.sm-rail-btn:hover {
  filter: brightness(1.06);
}

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

.sm-rail-btn > span,
.sm-main-dock-btn > span,
.sm-basement-btn > span,
.sm-quick-stock-btn > span {
  pointer-events: none;
}

.sm-rail-btn.is-blue   { background: linear-gradient(180deg, #74b9eb, #488ec4); }
.sm-rail-btn.is-purple { background: linear-gradient(180deg, #b39ddb, #866ec2); }
.sm-rail-btn.is-coral  { background: linear-gradient(180deg, #f2846e, #d95a44); }
.sm-rail-btn.is-mint   { background: linear-gradient(180deg, #74cf9f, #4aa878); }
.sm-rail-btn.is-orange { background: linear-gradient(180deg, #f8b259, #df892c); }

.sm-rail-ico {
  font-size: 1.32rem;
  line-height: 1.05;
}

.sm-rail-lbl {
  font-size: 0.62rem;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
  white-space: nowrap;
}

.sm-notif-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.sm-rail-showcase-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sm-promo-floating-tag {
  position: absolute;
  left: 62px;
  background: #fde047;
  border: 1.5px solid #ca8a04;
  color: #713f12;
  font-size: 0.64rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.sm-rail-season-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sm-season-subpill {
  background: var(--c-cream);
  border: 1.5px solid var(--c-border);
  color: var(--c-text);
  font-size: 0.62rem;
  font-weight: 900;
  padding: 1px 8px;
  border-radius: 999px;
  margin-top: -6px;
  z-index: 2;
}

/* ==================== GIỮA PHÍA TRÊN (NGÀY · CHUẨN BỊ + NÚT MỞ) ==================== */
.sm-hud-topcenter {
  position: absolute;
  top: var(--sm-safe-top);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-day-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--c-cream);
  border: 2.5px solid var(--c-border);
  border-radius: 999px;
  padding: 7px 16px;
  box-shadow: 0 5px 14px rgba(67, 44, 31, 0.14);
  font-size: 0.88rem;
  color: var(--c-text);
  white-space: nowrap;
}

.sm-open-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 2.5px solid #307a52;
  background: linear-gradient(180deg, #6ed195, #47a770);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #307a52, inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.12s;
  white-space: nowrap;
}

.sm-open-pill-btn.is-night {
  background: linear-gradient(180deg, #fbbf24, #d97706);
  border-color: #92400e;
  box-shadow: 0 4px 0 #92400e;
}

.sm-open-pill-btn:hover {
  filter: brightness(1.05);
}

.sm-open-pill-btn:active {
  transform: scale(0.97);
}

.sm-delivery-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2.5px solid #d97706;
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  color: #78350f;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
  white-space: nowrap;
  animation: sm-pulse-soft 1.4s ease-in-out infinite;
}

@keyframes sm-pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* ==================== GÓC TRÊN PHẢI: SỐ DƯ TIỀN $ + TỜ GIẤY GHIM "HÔM NAY" ==================== */
.sm-hud-topright {
  position: absolute;
  top: var(--sm-safe-top);
  right: var(--sm-safe-right);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.sm-hud-topright > * {
  pointer-events: auto;
}

.sm-top-money-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sm-mini-round-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  background: var(--c-cream);
  cursor: pointer;
  font-size: 0.92rem;
  box-shadow: 0 4px 10px rgba(67, 44, 31, 0.12);
}

.sm-money-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--c-cream);
  border: 2.8px solid #d4b48c;
  border-radius: 999px;
  padding: 5px 18px 5px 7px;
  box-shadow: 0 6px 16px rgba(67, 44, 31, 0.15);
}

.sm-gold-coin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef08a, #f59e0b);
  border: 2.5px solid #d97706;
  color: #b45309;
  font-size: 1rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.sm-money-pill strong {
  font-size: 1.25rem;
  font-weight: 900;
  color: #3b281e;
  font-variant-numeric: tabular-nums;
}

/* Tờ giấy nhớ màu xanh bạc hà "Hôm nay" nghiêng nhẹ có đinh ghim đỏ (giống hệt ảnh mẫu!) */
.sm-today-sticky {
  position: relative;
  width: 282px;
  background: #dcf2ea;
  border: 2px solid #a7d7c5;
  border-radius: 18px;
  padding: 12px 14px 11px;
  box-shadow: 0 10px 22px rgba(45, 75, 65, 0.16);
  transform: rotate(1.1deg);
  transition: transform 0.15s;
}

.sm-sticky-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #ef4444;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.sm-sticky-head {
  text-align: center;
  font-size: 0.88rem;
  color: #2f4842;
  margin-bottom: 7px;
  cursor: pointer;
}

.sm-sticky-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sm-today-sticky.is-collapsed .sm-sticky-body {
  display: none;
}

.sm-today-sticky.is-collapsed {
  width: auto;
  padding: 8px 16px;
}

.sm-today-sticky.is-collapsed .sm-sticky-head {
  margin-bottom: 0;
}

.sm-sticky-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334e48;
  line-height: 1.35;
}

.sm-st-ico {
  font-size: 0.92rem;
  flex-shrink: 0;
}

/* ==================== NÚT HẦM KHO & THẺ "VIỆC HÔM NAY" BÊN PHẢI ==================== */
.sm-right-float {
  position: absolute;
  right: var(--sm-safe-right);
  top: 54%;
  transform: translateY(-50%);
  z-index: 27;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.sm-basement-btn {
  width: 66px;
  height: 70px;
  border-radius: 18px;
  border: 2.5px solid var(--c-border);
  background: var(--c-cream);
  box-shadow: 0 6px 14px rgba(67, 44, 31, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.12s;
}

.sm-basement-btn:hover {
  transform: translateY(-2px);
}

.sm-base-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #74b9eb, #468bc2);
  border: 2px solid #2b5b84;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.sm-base-lbl {
  font-size: 0.66rem;
  font-weight: 900;
  color: var(--c-text);
}

/* Cụm thẻ "☀️ Việc hôm nay" (Lật biển hiệu + Kiện hàng hôm nay) */
.sm-today-work-wrap {
  position: absolute;
  right: var(--sm-safe-right);
  bottom: calc(var(--sm-safe-bottom) + 86px);
  z-index: 27;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.sm-work-tag {
  background: var(--c-cream);
  border: 2px solid var(--c-border);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--c-text);
  box-shadow: 0 3px 8px rgba(67, 44, 31, 0.12);
}

.sm-work-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sm-work-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 16px;
  border: 2.5px solid #b47b22;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 5px 12px rgba(67, 44, 31, 0.16);
  transition: transform 0.12s;
}

.sm-work-card:hover:not(:disabled) {
  transform: translateY(-2px);
}

.sm-work-card.is-gold {
  background: linear-gradient(180deg, #ffe082, #f5ba42);
  color: #4a2c11;
}

.sm-work-card.is-gift {
  background: linear-gradient(180deg, #fff5d6, #fde68a);
  color: #4a2c11;
}

.sm-wc-ico {
  font-size: 1.38rem;
}

.sm-wc-txt strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
}

.sm-wc-txt small {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  opacity: 0.88;
}

/* ==================== NÚT TƯƠNG TÁC NHANH THEO VỊ TRÍ NHÂN VẬT [E] ==================== */
.sm-player-action-btn {
  position: absolute;
  left: 50%;
  bottom: calc(var(--sm-safe-bottom) + 6px);
  transform: translateX(-50%);
  z-index: 33;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2.5px solid #307a52;
  background: linear-gradient(180deg, #6ed195, #47a770);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #307a52, 0 10px 22px rgba(48, 122, 82, 0.28);
  white-space: nowrap;
}

.sm-player-action-btn:active {
  transform: translateX(-50%) scale(0.97);
}

.sm-pa-kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.24);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  font-weight: 900;
}

/* ==================== KHAY DOCK GÓC DƯỚI TRÁI & PHẢI CHUẨN MẪU ==================== */
.sm-dock-left,
.sm-dock-right {
  position: absolute;
  bottom: var(--sm-safe-bottom);
  z-index: 32;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 10px 8px;
  background: rgba(255, 249, 239, 0.94);
  border: 2.8px solid var(--c-border);
  border-radius: 22px;
  box-shadow: 0 8px 22px rgba(67, 44, 31, 0.18);
}

.sm-dock-left {
  left: var(--sm-safe-left);
}

.sm-dock-right {
  right: var(--sm-safe-right);
}

.sm-main-dock-btn {
  position: relative;
  width: 72px;
  height: 70px;
  border-radius: 18px;
  border: 2.5px solid rgba(67, 44, 31, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: #ffffff;
  box-shadow: 0 4px 0 rgba(67, 44, 31, 0.24), inset 0 2px 0 rgba(255, 255, 255, 0.42);
  transition: transform 0.12s;
}

.sm-main-dock-btn:hover {
  filter: brightness(1.05);
}

.sm-main-dock-btn:active {
  transform: scale(0.96);
}

.sm-main-dock-btn.is-red    { background: linear-gradient(180deg, #ef7665, #d64b38); border-color: #992d1f; }
.sm-main-dock-btn.is-yellow { background: linear-gradient(180deg, #ffd464, #eab026); border-color: #a6760c; color: #451a03; }
.sm-main-dock-btn.is-sky    { background: linear-gradient(180deg, #7cc2f2, #4c95cc); border-color: #2c6591; }
.sm-main-dock-btn.is-violet { background: linear-gradient(180deg, #ba9af5, #8c66d4); border-color: #5a3b9c; }
.sm-main-dock-btn.is-teal   { background: linear-gradient(180deg, #6dc7a5, #439c7b); border-color: #276950; }

.sm-md-ico {
  font-size: 1.55rem;
  line-height: 1.05;
}

.sm-md-lbl {
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.sm-main-dock-btn:not(.is-yellow) .sm-md-lbl {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sm-count-badge {
  position: absolute;
  top: -7px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.sm-count-badge.is-green {
  background: #22c55e;
}

/* ==================== BẢNG QUẦY TÍNH TIỀN GỌN ĐẸP BÊN TRÁI (VỪA KHÍT KHÔNG CẮT DÒNG CUỐI) ==================== */
.sm-checkout-drawer {
  position: absolute;
  left: var(--sm-safe-left);
  bottom: calc(var(--sm-safe-bottom) + 84px);
  width: 415px;
  max-width: calc(100% - var(--sm-safe-left) - var(--sm-safe-right));
  max-height: calc(100% - var(--sm-safe-top) - var(--sm-safe-bottom) - 88px);
  z-index: 40;
  background: var(--c-cream);
  border: 3px solid #d4a373;
  border-radius: 22px;
  box-shadow: 0 20px 46px rgba(67, 44, 31, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sm-chk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px;
  background: #fde68a;
  border-bottom: 2px solid #e6c670;
  font-size: 0.88rem;
}

.sm-chk-body {
  padding: 9px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.82rem;
}

.sm-chk-layout {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sm-chk-col-left,
.sm-chk-col-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sm-chk-finish-btn {
  min-height: 42px;
  font-size: 0.9rem !important;
  padding: 9px 12px !important;
}

/* Ô nhập giá bán bằng tay sắc nét trên cả PC & Mobile */
.sm-price-edit-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sm-price-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 2px solid #d4a373;
  border-radius: 9px;
  padding: 2px 6px;
  font-weight: 900;
  color: #166534;
  font-size: 0.82rem;
}

.sm-price-input-wrap:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.sm-price-input {
  width: 56px;
  border: none;
  outline: none;
  background: transparent;
  color: #166534;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  text-align: center;
  padding: 2px 0;
  user-select: text;
}

.sm-belt-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  background: #334155;
  border-radius: 13px;
  border: 2px solid #475569;
}

.sm-belt-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
  padding: 5px 5px;
  border-radius: 11px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s;
}

.sm-belt-item:hover {
  border-color: #22c55e;
  background: #f0fdf4;
}

.sm-belt-item:active {
  transform: scale(0.96);
}

.sm-denom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.sm-denom-btn {
  min-height: 36px;
  padding: 6px 5px;
  border-radius: 10px;
  border: 2px solid #86efac;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
}

.sm-denom-btn:active {
  transform: scale(0.95);
}

.sm-denom-btn.is-coin {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}

.sm-pos-box {
  background: #1e293b;
  color: #ffffff;
  border-radius: 14px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sm-pos-screen {
  background: #064e3b;
  border: 2px solid #10b981;
  border-radius: 10px;
  padding: 7px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sm-pos-screen strong {
  font-size: 1.15rem !important;
}

.sm-pos-screen.is-err {
  background: #4c0519;
  border-color: #fb7185;
}

.sm-pos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.sm-pos-k {
  min-height: 40px;
  padding: 6px 5px;
  border-radius: 10px;
  border: none;
  background: #334155;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
}

.sm-pos-k:active { transform: scale(0.95); }

.sm-pos-k:hover { background: #475569; }
.sm-pos-k.is-accent { background: #0ea5e9; }
.sm-pos-k.is-warn   { background: #f59e0b; }

/* ==================== MODAL ĐA NĂNG SẮC NÉT ==================== */
.sm-checkout-drawer button,
.sm-modal-box button,
.sm-main-dock-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sm-modal-mask {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(54, 36, 25, 0.54);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.sm-modal-box {
  width: 940px;
  max-width: 100%;
  max-height: calc(100% - 16px);
  background: var(--c-cream);
  border: 3.5px solid #d4a373;
  border-radius: 28px;
  box-shadow: 0 24px 55px rgba(54, 36, 25, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--c-cream-dark);
  border-bottom: 2.5px solid #e2cdb0;
}

.sm-modal-head-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sm-modal-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #ffffff;
  border: 2px solid #e2cdb0;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}

.sm-modal-head-left h3 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 900;
}

.sm-modal-head-left p {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--c-muted);
}

.sm-close-x {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #d6c2a8;
  background: #ffffff;
  color: var(--c-text);
  font-weight: 900;
  cursor: pointer;
}

.sm-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* ==================== THÀNH PHẦN DÙNG CHUNG TRONG MODAL ==================== */
.sm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sm-tab-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid #decbb2;
  background: #ffffff;
  color: var(--c-text);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.sm-tab-pill.active {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
}

.sm-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 11px;
}

.sm-item-card {
  background: #ffffff;
  border: 2px solid #ece0cf;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 9px;
}

.sm-item-card.is-locked {
  opacity: 0.58;
  background: #faf6f0;
}

.sm-item-card-compact {
  padding: 10px 11px;
  gap: 8px;
  border-radius: 15px;
}

.sm-item-card-compact.is-selected {
  border-color: #f59e0b;
  background: #fffdf2;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.14);
}

.sm-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 9px;
}

/* Thanh đặt hàng ghim cố định trên cùng của Đại lý sỉ */
.sm-sticky-order-bar {
  position: sticky;
  top: -16px;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  border: 2.5px solid #f59e0b;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 8px 18px rgba(146, 64, 14, 0.14);
}

.sm-sticky-order-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.sm-order-top-btn {
  padding: 9px 18px !important;
  font-size: 0.84rem !important;
  border-radius: 13px !important;
  white-space: nowrap;
}

/* Thanh công cụ gọn trên đầu các Modal (Hầm kho, Kệ, Sắp xếp) */
.sm-modal-toolbar {
  position: sticky;
  top: -16px;
  z-index: 7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff9ef;
  border: 2px solid #e7d4b9;
  border-radius: 15px;
  padding: 9px 12px;
  box-shadow: 0 5px 12px rgba(67, 44, 31, 0.08);
}

.sm-wholesale-ctrl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  border-top: 1px solid #f2e8da;
  padding-top: 7px;
}

.sm-btn-xs {
  min-height: 34px;
  padding: 6px 11px !important;
  font-size: 0.77rem !important;
  border-radius: 10px !important;
}

.sm-transit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #ecfdf5;
  border: 2px solid #6ee7b7;
  border-radius: 14px;
  padding: 8px 13px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #065f46;
}

.sm-shelf-switcher {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.sm-shelf-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 2px solid #decbb2;
  background: #ffffff;
  color: var(--c-text);
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.sm-shelf-tab.active {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
}

.sm-tier-rack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sm-tier-row {
  background: #ffffff;
  border: 2px solid #e7d4b9;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sm-tier-row.is-empty {
  border-style: dashed;
  background: #fffdf8;
}

.sm-tier-row.is-editing {
  border-color: #f59e0b;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.16);
}

.sm-tier-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sm-tier-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.sm-tier-num {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fef3c7;
  border: 1.8px solid #f59e0b;
  color: #78350f;
  font-size: 0.76rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sm-tier-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sm-tier-picker {
  border-top: 1.5px dashed #e7d4b9;
  padding-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sm-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 7px;
}

.sm-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 2px solid #ece0cf;
  background: #fffdf8;
  cursor: pointer;
  text-align: left;
  color: var(--c-text);
  min-height: 48px;
}

.sm-picker-item:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}

.sm-picker-item.is-current {
  border-color: #10b981;
  background: #ecfdf5;
}

.sm-picker-item.has-stock {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.sm-picker-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.sm-mini-prod-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.sm-mini-prod-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 2px 5px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #5c3a28;
}

.sm-mini-prod-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.sm-compact-note {
  background: #faf5eb;
  border: 1.5px dashed #decbb2;
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 0.76rem;
  color: #6b5647;
}

/* Nút Xếp nhanh thùng hàng nổi cạnh Hầm kho */
.sm-quick-stock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 16px;
  border: 2.5px solid #15803d;
  background: linear-gradient(180deg, #86efac, #34d399);
  color: #064e3b;
  cursor: pointer;
  box-shadow: 0 5px 0 #15803d, 0 8px 16px rgba(6, 78, 59, 0.22);
  transition: transform 0.12s;
}

.sm-quick-stock-btn:hover {
  transform: translateY(-2px);
}

.sm-qs-ico {
  font-size: 1.15rem;
  line-height: 1;
}

.sm-qs-lbl {
  font-size: 0.62rem;
  font-weight: 900;
  white-space: nowrap;
}

/* Ảnh sản phẩm siêu thị to, sắc nét, nổi bật trong Đại lý sỉ, Sổ tay, Kệ & Hầm kho! */
.sm-prod-art-lg {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 3px;
}

.sm-prod-art-md {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
  padding: 3px;
}

.sm-shelf-art-lg {
  width: 74px;
  height: 92px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 4px;
}

.sm-shelf-art-md {
  width: 58px;
  height: 74px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 3px;
}

.sm-ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 12px;
  border: 2px solid rgba(67, 44, 31, 0.16);
  font-size: 0.79rem;
  font-weight: 900;
  cursor: pointer;
  transition: filter 0.1s, transform 0.08s;
}

.sm-ui-btn:hover:not(:disabled) { filter: brightness(1.04); }
.sm-ui-btn:active:not(:disabled) { transform: scale(0.96); }
.sm-ui-btn:disabled { opacity: 0.44; cursor: not-allowed; }

.sm-ui-btn.is-mint  { background: #6ee7b7; color: #064e3b; border-color: #34d399; }
.sm-ui-btn.is-gold  { background: #fde68a; color: #78350f; border-color: #f59e0b; }
.sm-ui-btn.is-sky   { background: #bae6fd; color: #0c4a6e; border-color: #38bdf8; }
.sm-ui-btn.is-coral { background: #fecdd3; color: #881337; border-color: #fb7185; }
.sm-ui-btn.is-soft  { background: #f5f0e8; color: #432c1f; border-color: #decbb2; }

.sm-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 9px;
}

.sm-stat-box {
  background: #ffffff;
  border: 2px solid #ece0cf;
  border-radius: 16px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sm-stat-box small {
  font-size: 0.72rem;
  color: var(--c-muted);
  font-weight: 700;
}

.sm-stat-box strong {
  font-size: 1rem;
  font-weight: 900;
}

.sm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.sm-badge.mint  { background: #d1fae5; color: #065f46; }
.sm-badge.sky   { background: #e0f2fe; color: #075985; }
.sm-badge.amber { background: #fef3c7; color: #92400e; }
.sm-badge.rose  { background: #ffe4e6; color: #9f1239; }

.sm-input {
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid #decbb2;
  background: #ffffff;
  color: var(--c-text);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ==================== TOAST STACK ==================== */
.sm-toast-stack {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.sm-toast-item {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.97);
  border: 2.5px solid #34d399;
  color: var(--c-text);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(67, 44, 31, 0.16);
}

.sm-toast-item.is-amber { border-color: #f59e0b; background: #fffbeb; }
.sm-toast-item.is-rose  { border-color: #f43f5e; background: #fff1f2; }

/* ==================== ONLINE CO-OP MULTIPLAYER (TỐI ĐA 3 NGƯỜI) ==================== */
.sm-big-btn.is-coop {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 0 #1e40af;
}

.sm-big-btn.is-coop:hover:not(:disabled) {
  filter: brightness(1.06);
}

.sm-coop-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 2.5px solid #2b6cb0;
  background: linear-gradient(180deg, #e0f2fe, #bae6fd);
  color: #0c4a6e;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.16);
  white-space: nowrap;
}

.sm-coop-pill-btn:hover {
  filter: brightness(1.04);
}

.sm-coop-pill-btn.is-online {
  border-color: #15803d;
  background: linear-gradient(180deg, #dcfce7, #86efac);
  color: #14532d;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.sm-coop-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #ecfdf5);
  border: 2.5px solid #60a5fa;
}

.sm-coop-code-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #1e3a8a;
}

.sm-coop-member-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sm-coop-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 13px;
  background: #ffffff;
  border: 2px solid #ece0cf;
}

.sm-coop-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0, 0, 0, 0.18);
}

.sm-coop-emote-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sm-coop-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

/* ==================== RESPONSIVE MOBILE & TABLET (1 GIAO DIỆN CHUẨN DUY NHẤT QUA .sm-ui-stage) ==================== */
@media (max-width: 767px) and (orientation: portrait) {
  .sm-rotate-overlay {
    display: flex;
  }
}

/* Mọi màn hình nhỏ / điện thoại (kể cả chưa kịp kích hoạt JS class): ẩn thanh web ngoài & giữ toàn khung gọn sạch */
@media (pointer: coarse), (max-width: 960px), (max-height: 560px) {
  body:has(#sm-cozy-root) .portal-header,
  body:has(#sm-cozy-root) .portal-topbar,
  body:has(#sm-cozy-root) .portal-sidebar,
  body:has(#sm-cozy-root) .portal-sidebar-backdrop,
  body:has(#sm-cozy-root) .portal-mobile-search-panel,
  body:has(#sm-cozy-root) header.site-header,
  body:has(#sm-cozy-root) .navbar {
    display: none !important;
  }

  body:has(#sm-cozy-root) .portal-main-area,
  body:has(#sm-cozy-root) .portal-layout,
  body:has(#sm-cozy-root) .portal-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .sm-cozy-root {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    z-index: 950;
  }
}

/* Modal luôn gọn gàng trong vùng an toàn 4 cạnh của khung chuẩn 1280x720 */
.sm-modal-mask {
  padding: var(--sm-safe-top) var(--sm-safe-right) var(--sm-safe-bottom) var(--sm-safe-left);
}
