:root {
  --bg: #0a0e14;
  --bg-elevated: #121820;
  --card: #171f2b;
  --card-hover: #1e2836;
  --accent: #d4243f;
  --accent-soft: rgba(212, 36, 63, 0.15);
  --accent-glow: rgba(212, 36, 63, 0.35);
  --gold: #f0c14a;
  --text: #f4f7fb;
  --muted: #8b9cb3;
  --border: rgba(148, 163, 184, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: 'Vazirmatn', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 36, 63, 0.12), transparent),
    var(--bg);
}

#app { min-height: 100vh; padding-bottom: 96px; }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: rgba(10, 14, 20, 0.88);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  backdrop-filter: blur(16px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
}

.login-logo {
  display: block;
  width: 120px;
  height: 120px;
}

.topbar h1 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.icon-btn:hover { background: var(--card-hover); border-color: var(--accent-glow); }

.icon-btn .icon { display: flex; width: 20px; height: 20px; }
.icon-btn .icon svg { width: 100%; height: 100%; }

.hidden { display: none !important; }

/* ── Main ── */
main {
  padding: 16px 16px 28px;
  max-width: 760px;
  margin: 0 auto;
}

main.home-main {
  padding: 0 0 28px;
  max-width: none;
}

/* ── Home page ── */
.home-page {
  background:
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(212, 36, 63, 0.08), transparent),
    var(--bg);
}

/* ── Home spotlight (poster carousel) ── */
.home-spotlight {
  position: relative;
  margin: 0 0 20px;
  padding: 18px 0 8px;
  overflow: hidden;
}

.home-spotlight-glow {
  position: absolute;
  left: 50%;
  top: 8%;
  width: min(78vw, 340px);
  height: min(58vw, 280px);
  transform: translateX(-50%);
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(48px) saturate(1.25);
  opacity: 0.42;
  pointer-events: none;
  transition: background-image 0.5s ease, opacity 0.35s ease;
}

.home-spotlight-glow::after {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at center, transparent 20%, rgba(10, 14, 20, 0.55) 70%),
    linear-gradient(180deg, transparent 40%, rgba(10, 14, 20, 0.9) 100%);
}

.home-spotlight-rail {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 10px max(16px, calc(50% - 112px)) 6px;
  cursor: grab;
}

.home-spotlight-rail::-webkit-scrollbar { display: none; }

.home-spotlight-rail.is-dragging,
.home-spotlight-rail:active { cursor: grabbing; }

.home-spotlight-rail.is-dragging {
  scroll-snap-type: none;
}

.home-spotlight-card {
  flex: 0 0 auto;
  width: min(56vw, 224px);
  padding: 0;
  border: 0;
  background: transparent;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  cursor: pointer;
  transform: scale(0.86);
  opacity: 0.48;
  transition: transform 0.35s ease, opacity 0.35s ease, filter 0.35s ease;
  filter: brightness(0.78);
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-x;
  outline: none;
}

.home-spotlight-card.is-active {
  transform: scale(1);
  opacity: 1;
  filter: brightness(1);
  z-index: 2;
}

.home-spotlight-poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.25);
}

.home-spotlight-card.is-active .home-spotlight-poster {
  border-color: rgba(240, 193, 74, 0.35);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 36, 63, 0.28);
}

.home-spotlight-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.home-spotlight-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 4px;
  text-align: center;
}

.home-spotlight-title {
  margin: 0;
  max-width: 18ch;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.45;
  min-height: 1.45em;
  transition: opacity 0.25s ease;
}

.home-spotlight-dots {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 12px 0 4px;
}

.home-spotlight-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: width 0.25s ease, background 0.2s ease;
}

.home-spotlight-dot.is-active {
  width: 18px;
  background: var(--accent);
}

.home-section {
  padding: 0 20px;
  max-width: 760px;
  margin: 0 auto;
}

.home-tabs {
  display: flex;
  gap: 0;
  margin: 16px 0 18px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border);
}

.home-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.home-tab.active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.home-scroll-wrap {
  position: relative;
  margin-inline: -20px;
  overflow: visible;
}

.home-scroll-wrap::before,
.home-scroll-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 12px;
  width: 14px;
  z-index: 2;
  pointer-events: none;
}

.home-scroll-wrap::before {
  right: 0;
  background: linear-gradient(to left, rgba(10, 14, 20, 0.88), transparent);
}

.home-scroll-wrap::after {
  left: 0;
  background: linear-gradient(to right, rgba(10, 14, 20, 0.88), transparent);
}

/* لیست افقی — RTL طبیعی، اسکرول لمسی بومی */
.home-scroll-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: auto;
  padding: 8px 20px 16px;
  margin-bottom: 4px;
  scrollbar-width: none;
  direction: rtl;
  scroll-behavior: auto;
}

.home-scroll-row.is-dragging {
  scroll-snap-type: none;
}

.home-scroll-row::-webkit-scrollbar { display: none; }

.home-scroll-row .card-show-h {
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (pointer: coarse) {
  .home-scroll-row {
    gap: 10px;
    padding-block: 10px 18px;
    scroll-snap-type: none;
    overscroll-behavior-x: auto;
  }

  .home-scroll-row .card-show-h {
    transition: none;
  }

  .home-scroll-row .card-show-h:active {
    transform: none;
  }
}

.card-show-h {
  flex: 0 0 188px;
  max-width: 188px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, var(--card) 100%);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card-show-h:active { transform: scale(0.98); }

@media (hover: hover) and (pointer: fine) {
  .home-scroll-row {
    cursor: grab;
    user-select: none;
  }

  .home-scroll-row.is-dragging {
    cursor: grabbing;
  }

  .card-show-h:active { transform: scale(0.97); }

  .card-show-h:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 36, 63, 0.45);
    box-shadow: 0 14px 32px rgba(212, 36, 63, 0.18);
  }
}

.card-show-h .thumb {
  border-radius: 14px 14px 0 0;
}

.card-show-h .meta { padding: 12px 14px 14px; }

.card-show-h h3 {
  font-size: 0.88rem;
  -webkit-line-clamp: 2;
}

.card-show-h .price { font-size: 0.8rem; margin-top: 4px; }

.home-groups-row .card-show-h { flex: 0 0 168px; max-width: 168px; }

.home-section-title {
  margin-top: 16px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
}

.home-section-title > span {
  flex: 0 0 auto;
  min-width: 0;
}

.home-section-title .home-more,
a.home-more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin: 0 !important;
  margin-inline-start: 0 !important;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent) !important;
  text-decoration: none;
  padding: 2px 0;
  line-height: 1.2;
}

.home-section-title .home-more:hover,
a.home-more:hover {
  text-decoration: underline;
}

/* عنوان گروه‌ها + مشاهده همه در یک خط، کنار هم */
.home-groups-heading {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  margin: 20px 0 14px;
}

.home-groups-heading > span {
  flex: 0 0 auto;
}

.home-groups-heading .home-more {
  position: relative;
  z-index: 1;
}

.home-empty {
  padding: 24px 12px;
  font-size: 0.85rem;
}

/* ── Bottom banner slider (fade/slide — no overflow scroll) ── */
.home-bottom-slider-section {
  margin-top: 28px;
  margin-bottom: 16px;
  padding: 0 20px 4px;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  box-sizing: border-box;
}

.home-bottom-slider {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  width: 100%;
  touch-action: pan-y;
}

.home-bottom-track {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.home-bottom-track:active { cursor: grabbing; }

.home-bottom-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  cursor: pointer;
}

.home-bottom-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.home-bottom-slide img,
.home-bottom-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #0a0e14;
  pointer-events: none;
}

.home-bottom-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 10px 0 12px;
  background: transparent;
}

.home-bottom-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}

.home-bottom-dot.is-active {
  width: 18px;
  border-radius: 999px;
  background: var(--accent);
}

@media (min-width: 900px) {
  .home-bottom-slider-section {
    max-width: 720px;
    margin-inline: auto;
    padding-inline: 0;
    margin-top: 40px;
  }
}

.home-list-section {
  margin-bottom: 44px;
}

.home-list-section .home-section-title {
  margin-bottom: 20px;
}

.group-gallery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  margin: 12px auto 0;
}

.gallery-modal-card {
  max-width: min(960px, calc(100vw - 16px));
  width: calc(100% - 16px);
  max-height: min(90vh, 820px);
  height: auto;
  overflow: hidden;
  padding: 14px 14px 10px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.gallery-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-inline: 4px;
  flex: 0 0 auto;
}

.gallery-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.gallery-grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(72vh, 640px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.gallery-thumb {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: right;
  min-width: 0;
  width: 100%;
}

.gallery-thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: none;
  min-height: 0;
  object-fit: cover;
  display: block;
}

.gallery-thumb-cap {
  display: none;
}

@media (max-width: 899px) {
  .gallery-modal-card {
    max-width: calc(100vw - 12px);
    width: calc(100vw - 12px);
    max-height: 88vh;
    padding: 12px 10px 8px;
    border-radius: 16px;
  }

  .gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .gallery-thumb {
    border-radius: 8px;
  }
}

@media (min-width: 900px) {
  .gallery-modal-card {
    padding: 16px 16px 12px;
  }

  .gallery-grid {
    gap: 10px;
  }
}

@media (min-width: 1100px) {
  .gallery-modal-card {
    max-width: min(1040px, calc(100vw - 24px));
  }

  .gallery-grid {
    gap: 12px;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.hidden { display: none !important; }

.lightbox-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

#lightboxImg {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-caption {
  margin: 12px 0 0;
  color: #ddd;
  font-size: 0.88rem;
  text-align: center;
}

.home-credit {
  margin: 24px 0 8px;
  font-size: 0.72rem;
}

.irappco-credit {
  text-align: center;
  margin: 20px 0 8px;
  font-size: 0.78rem;
}

.irappco-credit a {
  color: var(--muted);
  text-decoration: none;
  opacity: 0.85;
}

.irappco-credit a:hover {
  color: var(--gold);
  text-decoration: underline;
  opacity: 1;
}

.login-credit {
  margin-top: 16px;
  margin-bottom: 0;
}

.profile-page .irappco-credit {
  margin-top: 28px;
  padding-bottom: 8px;
}

@media (min-width: 640px) {
  .home-spotlight { padding: 24px 0 10px; }
  .home-spotlight-rail { padding-inline: max(24px, calc(50% - 130px)); gap: 18px; }
  .home-spotlight-card { width: min(42vw, 260px); }
  .home-spotlight-title { font-size: 1.28rem; max-width: 22ch; }
  .card-show-h { flex: 0 0 220px; max-width: 220px; }
  .card-show.card-show-h .thumb { height: 252px; }
  .card-show.card-show-h.card-group .thumb { height: auto; }
  .home-groups-row .card-show-h { flex: 0 0 200px; max-width: 200px; }
}

.loading-state, .empty-state, .error-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.error-state { color: #f87171; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  background: rgba(18, 24, 32, 0.95);
  border-top: 1px solid var(--border);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
  backdrop-filter: blur(16px);
  gap: 4px;
}

.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 4px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.bottom-nav button .nav-icon {
  display: flex;
  width: 22px;
  height: 22px;
}

.bottom-nav button .nav-icon svg { width: 100%; height: 100%; }

.bottom-nav button.active {
  color: var(--text);
  background: var(--accent-soft);
}

.bottom-nav button.active .nav-icon { color: var(--accent); }

.nav-credit {
  flex: 0 0 100%;
  margin: 2px 0 0;
  padding: 0 4px;
  font-size: 0.62rem;
  line-height: 1.3;
}

/* موبایل: اعتبار زیر منوی پایین دیده نشود */
@media (max-width: 899px) {
  .bottom-nav .nav-credit {
    display: none !important;
  }
}

.nav-credit a {
  font-size: inherit;
}

/* دسکتاپ: منو سایدبار سمت راست */
@media (min-width: 900px) {
  #app {
    padding-bottom: 0;
    padding-right: 220px;
  }

  .bottom-nav {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    width: 220px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    border-top: none;
    border-left: 1px solid var(--border);
    padding: 28px 14px 20px;
    background: rgba(14, 18, 26, 0.98);
  }

  .bottom-nav button {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    font-size: 0.92rem;
    border-radius: 12px;
  }

  .bottom-nav button .nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .bottom-nav button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
  }

  .nav-credit {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 16px 8px 4px;
    font-size: 0.7rem;
  }

  .topbar {
    padding-inline: 24px;
  }

  main {
    max-width: 980px;
    margin-inline-start: 0;
    margin-inline-end: auto;
    padding: 24px 28px 40px;
  }

  main.home-main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 0 40px;
  }

  .home-section {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 28px 0 32px;
  }

  .home-spotlight {
    padding-top: 28px;
  }

  .home-spotlight-rail {
    padding-inline: max(32px, calc(50% - 150px));
  }

  .home-spotlight-card {
    width: 300px;
  }

  .home-scroll-wrap {
    margin-inline: -28px;
  }

  .home-scroll-row {
    padding-right: 28px;
    padding-left: 32px;
  }

  main.search-main,
  main.profile-main,
  main.group-main,
  main.show-main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 28px 40px 48px;
  }

  .search-page {
    max-width: 920px;
  }

  .search-heading {
    font-size: 1.45rem;
  }

  .search-hint {
    font-size: 0.92rem;
    margin-bottom: 18px;
  }

  .search-panel {
    max-width: 640px;
    margin-bottom: 28px;
  }

  .search-input-wrap .search-box {
    padding: 16px 48px 16px 18px;
    font-size: 1rem;
  }

  .search-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .search-result {
    padding: 12px 14px;
  }

  .search-result-thumb {
    width: 56px;
    height: 74px;
  }

  .search-result-title {
    font-size: 0.98rem;
  }

  .profile-page {
    max-width: 860px;
    margin: 0;
  }

  .profile-header-card {
    padding: 28px 32px;
    gap: 20px;
    margin-bottom: 22px;
  }

  .profile-avatar {
    width: 88px;
    height: 88px;
  }

  .profile-avatar svg { width: 40px; height: 40px; }

  .profile-name {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }

  .profile-phone {
    font-size: 0.92rem;
  }

  .profile-edit-btn {
    font-size: 0.88rem;
    padding: 10px 20px;
  }

  .profile-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .profile-menu-item {
    padding: 18px 16px;
    font-size: 0.95rem;
  }

  .profile-menu-item.danger {
    grid-column: 1 / -1;
  }

  .profile-page .irappco-credit {
    margin-top: 28px;
  }

  .profile-subpage {
    max-width: 720px;
    margin: 0;
  }

  .group-page {
    max-width: none;
    width: 100%;
  }

  .group-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px 28px;
    text-align: right;
    width: 100%;
    padding: 22px 40px;
    margin-bottom: 8px;
    background:
      linear-gradient(135deg, rgba(212, 36, 63, 0.08), transparent 55%),
      var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    box-sizing: border-box;
  }

  .group-header .logo-wrap {
    width: 112px;
    height: 112px;
    margin: 0 !important;
    flex-shrink: 0;
    align-self: center;
    justify-self: start;
  }

  .group-header-text {
    min-width: 0;
    align-self: center;
  }

  .group-header h2 {
    font-size: 1.45rem;
    margin: 0 0 8px;
  }

  .group-header p {
    max-width: 68ch;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.8;
  }

  .group-header .group-gallery-btn,
  .group-header .group-gallery-btn.btn-secondary {
    margin: 0 !important;
    width: auto !important;
    max-width: none;
    height: auto;
    min-height: 0;
    justify-self: end;
    align-self: center;
    padding: 12px 18px !important;
    white-space: nowrap;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    line-height: 1.2;
  }

  .group-page .section-title {
    margin-top: 22px;
    margin-bottom: 16px;
    font-size: 1.05rem;
  }

  .group-shows-grid {
    grid-template-columns: repeat(auto-fill, 220px);
    justify-content: start;
    gap: 16px;
    width: 100%;
  }

  .group-shows-grid .card-show-h {
    border-radius: 14px;
    width: 220px;
    max-width: 220px;
  }

  .group-shows-grid .card-show.card-show-h .thumb {
    height: 252px;
  }

  .group-shows-grid .card-show-h .meta {
    padding: 12px 14px 14px;
  }

  .group-shows-grid .card-show-h h3 {
    font-size: 0.88rem;
  }

  .group-shows-grid .card-show-h .price {
    font-size: 0.8rem;
  }

  .group-shows-grid .card-show .badge {
    top: 10px;
    right: 10px;
    font-size: 0.68rem;
    padding: 4px 8px;
  }
}

@media (min-width: 1100px) {
  .group-header {
    padding: 24px 48px;
    gap: 24px 32px;
  }

  .group-header .logo-wrap {
    width: 120px;
    height: 120px;
  }
}

@media (min-width: 900px) and (max-width: 1099px) {
  .group-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 20px 36px;
  }
}

/* ── Section ── */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 20px 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: -0.02em;
}

.section-title span { position: relative; padding-right: 12px; }
.section-title span::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

/* صفحه خانه: «مشاهده همه» دقیقاً کنار «گروه‌های تئاتر» */
.home-page .home-groups-heading.section-title {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100%;
}

.home-page .home-groups-heading > span {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
}

.home-page .home-groups-heading .home-more {
  flex: 0 0 auto !important;
  display: inline-block !important;
  margin: 0 !important;
  margin-inline-start: 0 !important;
  white-space: nowrap !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: var(--accent) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ── Grid & cards ── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.group-shows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 220px);
  gap: 16px;
  justify-content: start;
  width: 100%;
}

.group-shows-grid .card-show-h {
  width: 220px;
  max-width: 220px;
  flex: none;
  border-radius: 14px;
}

.group-shows-grid .card-show.card-show-h .thumb {
  height: 252px;
  aspect-ratio: auto;
}

.group-shows-grid .card-show-h .meta {
  padding: 12px 14px 14px;
}

.group-shows-grid .card-show-h h3 {
  font-size: 0.88rem;
  margin-bottom: 0;
  -webkit-line-clamp: 2;
}

.group-shows-grid .card-show-h .price {
  font-size: 0.8rem;
  margin-top: 4px;
}

.group-shows-grid .card-show-h small {
  font-size: 0.75rem;
  margin-top: 4px;
}

.group-shows-grid .card-show .badge {
  top: 10px;
  right: 10px;
  font-size: 0.68rem;
  padding: 4px 8px;
  border-radius: 8px;
}

@media (max-width: 639px) {
  .group-shows-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .group-shows-grid .card-show-h {
    width: 100%;
    max-width: none;
  }

  .group-shows-grid .card-show.card-show-h .thumb {
    height: 222px;
  }
}

.card-show {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}

.card-show:hover {
  transform: translateY(-3px);
  border-color: var(--accent-glow);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.card-show .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg-elevated);
  overflow: hidden;
}

.card-show .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* کارت‌های افقی خانه: عرض بیشتر، ارتفاع پوستر مثل قبل */
.card-show.card-show-h .thumb {
  aspect-ratio: auto;
  height: 222px;
}

.card-show.card-show-h.card-group .thumb {
  aspect-ratio: 1;
  height: auto;
}

.card-show .badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10, 14, 20, 0.85);
  border: 1px solid var(--border);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.card-show .meta { padding: 12px 14px 14px; }

.card-show h3 {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-show .price {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
}

.card-show small {
  color: var(--muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.card-show small .mini-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.card-show small .mini-icon svg { width: 100%; height: 100%; }

/* Group card variant — square logo */
.card-group .thumb { aspect-ratio: 1; }

/* ── Group header ── */
.group-page {
  width: 100%;
}

.group-header {
  text-align: center;
  padding: 12px 20px 22px;
}

.group-header .logo-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
  background: var(--card);
}

.group-header .logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-header h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.group-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 480px;
  margin-inline: auto;
}

.group-header .group-gallery-btn {
  margin: 12px auto 0;
}

.hero-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.hero-slider::-webkit-scrollbar { display: none; }

.hero-slider img {
  width: 85%;
  max-width: 340px;
  border-radius: var(--radius);
  scroll-snap-align: start;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ── Show detail ── */
.show-detail {
  width: 100%;
  max-width: none;
}

.show-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.show-detail-media {
  order: -1;
  width: min(68%, 240px);
  margin-inline: auto;
}

.show-poster-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(212, 36, 63, 0.08);
  background: var(--bg-elevated);
}

.show-poster-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 70%, rgba(10, 14, 20, 0.35) 100%);
}

.show-hero {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: var(--bg-elevated);
}

.show-detail-head {
  margin-bottom: 4px;
}

.show-detail-title,
.show-detail h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.4;
}

.show-detail-group {
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(184, 134, 11, 0.12);
  border: 1px solid rgba(184, 134, 11, 0.28);
}

.show-detail-desc,
.show-detail p.show-detail-desc {
  color: var(--muted);
  line-height: 1.85;
  font-size: 0.92rem;
  margin: 14px 0 0;
}

.show-detail .duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 8px 0 4px;
}

.show-detail .duration .mini-icon {
  display: flex;
  width: 16px;
  height: 16px;
}

.show-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.show-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 140px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, color 0.2s;
}

.show-tool-btn:hover {
  border-color: rgba(212, 36, 63, 0.45);
  background: rgba(212, 36, 63, 0.1);
  transform: translateY(-1px);
}

.show-tool-btn:active {
  transform: translateY(0);
}

.show-tool-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
}

.show-tool-icon svg {
  width: 100%;
  height: 100%;
}

.show-tool-label {
  line-height: 1;
}

.show-tool-fav.is-active,
.show-tool-fav.is-active:hover {
  border-color: rgba(212, 36, 63, 0.55);
  background: rgba(212, 36, 63, 0.16);
  color: #fecaca;
}

.show-tool-fav.is-active .show-tool-icon {
  color: #f87171;
}

.show-cta {
  margin-top: 12px;
}

.show-cta .btn-watch,
.show-cta .btn-primary,
.show-cta .btn-buy {
  margin-top: 0;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.show-cta .mini-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.show-cta .mini-icon svg {
  width: 100%;
  height: 100%;
}

.show-cast {
  margin-top: 28px;
  padding-top: 8px;
}

.show-cast-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
}

.show-cast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.show-cast-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: default;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.show-cast-card.is-zoomable {
  cursor: zoom-in;
}

.show-cast-card.is-zoomable:hover {
  border-color: rgba(212, 36, 63, 0.4);
  background: var(--card-hover);
}

.show-cast-card.is-zoomable:active {
  transform: scale(0.98);
}

.show-cast-card:disabled {
  opacity: 1;
  cursor: default;
}

.show-cast-photo {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  pointer-events: none;
}

.show-cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.show-cast-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.show-cast-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.show-cast-role {
  font-size: 0.75rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .show-cast-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  main.show-main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 28px 40px 48px;
  }

  .show-detail {
    max-width: none;
    width: 100%;
    margin: 0;
  }

  .show-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px 48px;
    align-items: start;
    width: 100%;
  }

  .show-detail-media {
    order: 0;
    width: 280px;
    max-width: 280px;
    margin: 0;
    justify-self: end;
    position: sticky;
    top: 72px;
  }

  .show-detail-body {
    padding-top: 8px;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .show-detail-title {
    font-size: 1.75rem;
    max-width: 22ch;
  }

  .show-detail-desc {
    max-width: 58ch;
    font-size: 0.95rem;
  }

  .show-toolbar {
    max-width: 420px;
  }

  .show-cta {
    max-width: 420px;
    margin-top: 14px;
  }

  .show-detail .access-remain-box {
    max-width: 420px;
  }

  .show-cta .btn-watch,
  .show-cta .btn-primary {
    max-width: none;
  }

  .show-cast {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    width: 100%;
  }

  .show-cast-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
    justify-content: start;
    gap: 12px;
  }

  .show-cast-photo {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }
}

@media (min-width: 1200px) {
  .show-detail-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 32px 64px;
  }

  .show-cast-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
  }
}

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #a81830);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 14px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }

.btn-secondary {
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background: var(--card-hover); }

/* دکمه گالری در هدر گروه — هم‌تراز با لوگو، بدون margin عمومی btn */
.group-header .group-gallery-btn.btn-secondary {
  width: auto !important;
  margin: 0 !important;
  margin-top: 0 !important;
  align-self: center;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-outline:hover { border-color: var(--accent); background: var(--accent-soft); }

.btn-outline .mini-icon { display: flex; width: 18px; height: 18px; }

.show-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.show-actions .btn-secondary,
.show-actions .btn-outline {
  width: auto;
  flex: 1;
  min-width: 130px;
  margin-top: 0;
}

.btn-watch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.28);
  transition: opacity 0.2s, transform 0.2s;
}

.btn-watch:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.btn-watch .mini-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.access-remain-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.28);
}

.access-remain-box.access-free {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.28);
}

.access-remain-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.access-remain-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4ade80;
  line-height: 1.5;
}

.access-remain-box.access-free .access-remain-value {
  color: var(--gold);
}

.access-remain-num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.order-items {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item-row {
  padding: 8px 0 0;
}

.order-item-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.order-item-remain {
  font-size: 0.88rem;
  color: #4ade80;
  line-height: 1.5;
}

.order-item-remain.muted {
  color: var(--muted);
}

.order-item-remain .order-label {
  color: var(--muted);
  margin-left: 4px;
}

/* ── Forms ── */
.search-box {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box::placeholder { color: var(--muted); }

/* ── Search page ── */
.search-page {
  width: 100%;
}

.search-panel {
  margin-bottom: 20px;
}

.search-heading {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.search-hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.search-input-wrap {
  position: relative;
}

.search-input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}

.search-input-icon svg { width: 100%; height: 100%; }

.search-input-wrap .search-box {
  padding-right: 44px;
  margin-bottom: 0;
}

.search-block {
  margin-bottom: 22px;
}

.search-block-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  padding-inline: 2px;
}

.search-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  text-align: right;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.search-result:hover {
  background: var(--card-hover);
  border-color: var(--accent-glow);
}

.search-result-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-result-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-sub {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-chevron {
  display: flex;
  width: 16px;
  height: 16px;
  color: var(--muted);
  opacity: 0.55;
  flex-shrink: 0;
}

.search-result-chevron svg { width: 100%; height: 100%; }

.form-group { margin-top: 14px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-size: 0.92rem;
}

.profile-row:hover {
  background: var(--card-hover);
  border-color: var(--accent-glow);
}

.profile-row .row-icon {
  display: flex;
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Modal ── */
body.login-locked #app {
  pointer-events: none;
  filter: blur(4px);
}

.login-error {
  color: #f87171;
  font-size: 0.82rem;
  text-align: center;
  margin: 10px 0 0;
  min-height: 1.2em;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  backdrop-filter: blur(10px);
}

#galleryModal.modal {
  padding: 10px;
  align-items: center;
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.modal-icon {
  display: flex;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.modal-icon svg { width: 100%; height: 100%; }

.modal-card h2 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 8px;
}

.modal-card input {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  direction: ltr;
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
}

.modal-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.discount-modal-card .modal-sub {
  margin-bottom: 12px;
}

.discount-price-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 4px 0 8px;
}

.discount-price-box .order-row:last-child {
  margin-bottom: 0;
}

.discount-final {
  font-weight: 700;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.discount-msg-ok {
  color: #3ecf8e !important;
}

.discount-modal-card .btn-primary {
  margin-top: 10px;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.legal {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}

.legal a { color: var(--gold); text-decoration: none; }

/* ── Player ── */
body.player-active {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.player-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  direction: ltr;
}

.player-overlay.player-blocked .player-stage,
.player-overlay.player-blocked .player-controls {
  visibility: hidden;
}

.player-blocked-screen {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 105;
  background: #000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  direction: rtl;
}

.player-overlay.player-blocked .player-blocked-screen {
  display: flex;
}

.player-blocked-screen p {
  color: #f87171;
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 320px;
}

.player-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 110;
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.player-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #000;
}

.player-stage video {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 56px);
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

.player-stage video::-webkit-media-controls { display: none !important; }
.player-stage video::-webkit-media-controls-enclosure { display: none !important; }

.player-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 4;
  direction: ltr;
  color-scheme: dark;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

/* تمام‌صفحه: تصویر کامل + کنترل‌ها روی لایه و مخفی تا تاچ */
.player-overlay.is-fullscreen .player-stage,
.player-overlay:fullscreen .player-stage,
.player-overlay:-webkit-full-screen .player-stage {
  flex: 1;
  width: 100%;
  height: 100%;
}

.player-overlay.is-fullscreen .player-stage video,
.player-overlay:fullscreen .player-stage video,
.player-overlay:-webkit-full-screen .player-stage video {
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-overlay.is-fullscreen .player-controls,
.player-overlay:fullscreen .player-controls,
.player-overlay:-webkit-full-screen .player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88) 28%);
  border-top: none;
}

.player-overlay.is-fullscreen .player-close,
.player-overlay:fullscreen .player-close,
.player-overlay:-webkit-full-screen .player-close {
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.player-overlay.is-fullscreen.controls-hidden .player-controls,
.player-overlay.is-fullscreen.controls-hidden .player-close,
.player-overlay:fullscreen.controls-hidden .player-controls,
.player-overlay:fullscreen.controls-hidden .player-close,
.player-overlay:-webkit-full-screen.controls-hidden .player-controls,
.player-overlay:-webkit-full-screen.controls-hidden .player-close {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
}

.player-overlay.is-fullscreen.controls-hidden .player-close,
.player-overlay:fullscreen.controls-hidden .player-close,
.player-overlay:-webkit-full-screen.controls-hidden .player-close {
  transform: none;
}

.player-overlay.is-fullscreen,
.player-overlay:fullscreen,
.player-overlay:-webkit-full-screen {
  cursor: default;
}

.player-overlay.is-fullscreen.controls-hidden,
.player-overlay:fullscreen.controls-hidden,
.player-overlay:-webkit-full-screen.controls-hidden,
.player-overlay.is-fullscreen.controls-hidden .player-stage,
.player-overlay:fullscreen.controls-hidden .player-stage,
.player-overlay:-webkit-full-screen.controls-hidden .player-stage,
.player-overlay.is-fullscreen.controls-hidden .player-shield,
.player-overlay:fullscreen.controls-hidden .player-shield,
.player-overlay:-webkit-full-screen.controls-hidden .player-shield {
  cursor: none;
}

.player-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.player-controls-secondary {
  justify-content: flex-start;
}

.player-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.player-ctrl-main {
  width: 46px;
  height: 46px;
  background: var(--accent);
}

.player-ctrl-btn .icon { display: flex; width: 20px; height: 20px; }
.player-ctrl-btn .icon svg { width: 100%; height: 100%; }

.player-seek {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
  min-width: 0;
  direction: ltr;
}

.player-volume {
  width: 84px;
  accent-color: #4ade80;
  height: 4px;
  cursor: pointer;
  direction: ltr;
}

.player-rate-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
  margin-inline-start: auto;
}

.player-rate-wrap .icon {
  display: flex;
  width: 16px;
  height: 16px;
  opacity: 0.85;
  color: #fff;
}

.player-rate {
  -webkit-appearance: none;
  appearance: none;
  background-color: #1c222c !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23cbd5e1' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

.player-rate:focus {
  outline: none;
  border-color: rgba(196, 30, 58, 0.7);
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.25);
}

.player-rate option {
  background-color: #1c222c;
  color: #f1f5f9;
}

.player-time {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  min-width: 88px;
  text-align: center;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

@media print {
  .player-overlay { display: none !important; }
}

.cast-hint {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 10px;
  line-height: 1.6;
}

/* ── Profile page ── */
main.profile-main,
main.search-main,
main.group-main {
  padding: 12px 16px 28px;
}

.profile-page {
  max-width: 520px;
  margin: 0 auto;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.profile-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
}

.profile-avatar svg { width: 32px; height: 32px; }

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-identity { flex: 1; min-width: 0; }

.profile-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-phone {
  font-size: 0.82rem;
  color: var(--muted);
  direction: ltr;
  text-align: right;
}

.profile-edit-btn {
  flex-shrink: 0;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-edit-btn:hover { background: rgba(212, 36, 63, 0.25); }

.profile-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: right;
  transition: background 0.2s, border-color 0.2s;
}

.profile-menu-item:hover {
  background: var(--card-hover);
  border-color: var(--accent-glow);
}

.profile-menu-item .pmi-icon {
  display: flex;
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.profile-menu-item .pmi-icon svg { width: 100%; height: 100%; }

.profile-menu-item .pmi-label { flex: 1; }

.profile-menu-item .pmi-chevron {
  display: flex;
  width: 18px;
  height: 18px;
  color: var(--muted);
  opacity: 0.6;
}

.profile-menu-item.danger .pmi-icon,
.profile-menu-item.danger .pmi-label { color: #f87171; }

.profile-menu-item.danger { border-color: rgba(248, 113, 113, 0.2); }

.session-expired {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52vh;
  padding: 24px 8px;
}

.session-expired-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px 24px;
  box-shadow: var(--shadow);
}

.session-expired-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(212, 36, 63, 0.25);
}

.session-expired-icon svg {
  width: 28px;
  height: 28px;
}

.session-expired-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.session-expired-text {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.session-expired-btn {
  margin-top: 18px;
}

.profile-subpage {
  max-width: 520px;
  margin: 0 auto;
}

.profile-subpage.favorites-page {
  max-width: none;
  width: 100%;
  margin: 0;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 220px);
  gap: 16px;
  justify-content: start;
}

.favorites-grid .card-show-h {
  width: 220px;
  max-width: 220px;
  flex: none;
}

.favorites-grid .card-show.card-show-h .thumb {
  height: 252px;
  aspect-ratio: auto;
}

@media (max-width: 639px) {
  .favorites-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .favorites-grid .card-show-h {
    width: 100%;
    max-width: none;
  }

  .favorites-grid .card-show.card-show-h .thumb {
    height: 222px;
  }
}

.profile-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b9cb3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

.profile-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

.profile-edit-card {
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-width: 639px) {
  #profileEditModal {
    align-items: stretch;
    padding: 0;
  }

  #profileEditModal .profile-edit-card {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }
}

.profile-edit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-edit-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}

.jalali-picker-wrap {
  position: relative;
}

.jalali-date-input {
  cursor: pointer;
  caret-color: transparent;
}

.jalali-datepicker {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  z-index: 40;
  background: #121820;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.jalali-datepicker.hidden { display: none; }

.jdp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.jdp-nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.jdp-selectors {
  flex: 1;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.jdp-month,
.jdp-year {
  flex: 1;
  min-width: 0;
  appearance: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 0.85rem;
}

.jdp-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.jdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.jdp-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.jdp-day:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.jdp-day.empty {
  visibility: hidden;
  pointer-events: none;
}

.jdp-day.today {
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.55);
}

.jdp-day.selected {
  background: linear-gradient(135deg, var(--accent), #a81830);
  color: #fff;
}

.jdp-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.jdp-clear,
.jdp-today {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
}

.jdp-today {
  border-color: rgba(74, 222, 128, 0.35);
  color: #4ade80;
}

.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--text);
}

.order-label { color: var(--muted); }

.order-amount span:last-child {
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
}

.order-status {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.order-status.paid { color: #4ade80; }
.order-status.unpaid { color: #f87171; }

.support-page .btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.support-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.support-call-btn .mini-icon { display: flex; width: 20px; height: 20px; color: var(--accent); }

.support-phone-block {
  margin-top: 24px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.support-phone-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.support-phone-link {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 8px 12px;
  border-radius: 10px;
}

.support-phone-link.disabled {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.about-page {
  padding-top: 36px;
}

@media (min-width: 900px) {
  .about-page {
    padding-top: 48px;
  }
}

.about-page .about-html {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text, #1a1a1a);
}
.about-page .about-html p {
  margin: 0 0 1rem;
}
.about-page .about-html strong {
  font-weight: 700;
}
.about-page .about-lead {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.8;
  margin: 0 0 14px;
}

.about-page .about-text {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.9;
  margin: 0 0 16px;
}

.about-page .about-version {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 20px;
}

.about-link-btn {
  width: 100%;
  margin-top: 12px;
}

.contact-page .contact-lead {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0 0 14px;
}

.contact-page .contact-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.contact-icon {
  display: flex;
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-icon svg { width: 100%; height: 100%; }

.contact-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  direction: ltr;
  text-align: right;
  flex: 1;
}

.contact-text {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.7;
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 20px 0 8px;
}

.contact-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.contact-social-btn svg { width: 20px; height: 20px; }

.contact-social-btn:hover {
  border-color: var(--accent-glow);
  background: var(--card-hover);
}

.profile-section h4 {
  margin: 24px 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.profile-section ul {
  padding-right: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.9;
}

/* ── فقط موبایل / تبلت کوچک — دسکتاپ (≥900px) دست‌نخورده می‌ماند ── */
@media (max-width: 899px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  body {
    padding-top: env(safe-area-inset-top);
  }

  #app {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  .topbar {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-inline: 12px;
  }

  .topbar-brand {
    min-width: 0;
    padding-inline: 6px;
  }

  .topbar h1 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  }

  .brand-logo {
    flex-shrink: 0;
  }

  main {
    padding: 14px 14px 24px;
    overflow-x: hidden;
  }

  .home-section {
    padding: 0 14px;
    max-width: none;
  }

  .home-scroll-wrap {
    margin-inline: -14px;
  }

  .home-scroll-row {
    padding-inline: 14px;
  }

  .card-show-h {
    flex: 0 0 min(46vw, 188px);
    max-width: min(46vw, 188px);
  }

  .home-spotlight-card {
    width: min(58vw, 200px);
  }

  .home-spotlight-rail {
    padding-inline: max(14px, calc(50% - 100px));
  }

  .home-spotlight-title {
    font-size: 1.05rem;
    max-width: 16ch;
    padding-inline: 12px;
  }

  .show-tool-btn {
    flex: 1 1 100%;
    font-size: 0.82rem;
    padding: 12px 12px;
    min-height: 46px;
    gap: 6px;
  }

  .show-tool-label {
    text-align: center;
    line-height: 1.35;
    white-space: normal;
  }

  .show-detail-media {
    width: min(72%, 220px);
  }

  .show-detail-title {
    font-size: 1.2rem;
    line-height: 1.45;
    word-break: break-word;
  }

  .show-detail-desc {
    font-size: 0.88rem;
  }

  .favorites-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .favorites-grid .card-show-h {
    width: 100%;
    max-width: none;
    flex: none;
  }

  .favorites-grid .card-show.card-show-h .thumb {
    height: 222px;
    aspect-ratio: auto;
  }

  .profile-header-card {
    flex-wrap: wrap;
  }

  .profile-edit-btn {
    margin-right: auto;
  }

  .modal {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: min(92vh, 100%);
    overflow-y: auto;
    border-radius: 20px 20px 16px 16px;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  }

  .login-logo {
    width: min(28vw, 100px);
    height: min(28vw, 100px);
  }

  .contact-page .contact-block {
    padding: 14px 12px;
    gap: 12px;
  }

  .contact-link,
  .contact-text {
    font-size: 0.88rem;
    word-break: break-word;
  }

  .order-card {
    padding: 14px;
  }

  .bottom-nav {
    padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  }

  .bottom-nav button {
    font-size: 0.68rem;
    padding: 6px 2px;
    min-width: 0;
  }

  .bottom-nav button .nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 379px) {
  .card-show-h {
    flex: 0 0 152px;
    max-width: 152px;
  }

  .card-show.card-show-h .thumb {
    height: 190px;
  }

  .home-spotlight-card {
    width: min(62vw, 168px);
  }

  .show-tool-btn {
    font-size: 0.78rem;
  }

  .profile-header-card {
    gap: 10px;
    padding: 14px 12px;
  }

  .profile-avatar {
    width: 56px;
    height: 56px;
  }

  .favorites-grid .card-show.card-show-h .thumb {
    height: 190px;
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  #app {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .card-show-h {
    flex: 0 0 220px;
    max-width: 220px;
  }

  .favorites-grid {
    grid-template-columns: repeat(auto-fill, 220px);
    gap: 16px;
  }

  .favorites-grid .card-show-h {
    width: 220px;
    max-width: 220px;
  }

  .favorites-grid .card-show.card-show-h .thumb {
    height: 252px;
  }

  .modal {
    align-items: center;
  }

  .modal-card {
    max-width: 420px;
    border-radius: 20px;
    padding: 28px 24px;
  }

  .show-tool-btn {
    flex: 1 1 calc(50% - 6px);
    font-size: 0.88rem;
  }
}
