/* =========================================================================
   StudioFlow DriveGallery — Mode B Hybrid Scroll Rail & Mobile Hardening
   (`v3.3.3-sandbox` · Image 1 Top Original + Image 2 Compact Scroll Rail)
   ========================================================================= */

/* 0. Clean Gallery Simplifications Requested by Photographer/Client Feedback:
   - Hide Quick Filename Search Bar (`.client-search-box`)
   - Hide File Sizes (`#clientTotalSize`, `#lbInfoSizeRow`) -> Show Photo Count Only
   - Hide Unused Slideshow Controls (`#btnStartSlideshow`, `#fabSlideshowBtn`, `#btnLbSlideshow`, `#lbSlideshowBar`) */
#clientGalleryRoot .client-search-box,
#clientTotalSize,
#lbInfoSizeRow,
#btnStartSlideshow,
#fabSlideshowBtn,
#btnLbSlideshow,
#lbSlideshowBar {
  display: none !important;
}

/* 1. Collision-Free Toast Notification (`#toast`) */
html:has(#clientGalleryRoot:not([hidden])) .toast-banner {
  top: calc(max(10px, env(safe-area-inset-top)) + 66px);
  bottom: auto;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html:has(#builderShell:not([hidden])) .toast-banner {
  top: auto;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 16px));
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* 2. Single-Focus Messenger / In-App Escape State Machine
   - Prevents double `1 -> 2` instructions when `#inAppExternalGuidePopover` opens over `#iosPhotosBatchModal` */
dialog.is-obscured-by-ext-guide {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

dialog.is-obscured-by-ext-guide > :not(#inAppExternalGuidePopover) {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

dialog.is-obscured-by-ext-guide::backdrop {
  background: rgba(2, 6, 23, 0.82) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

html.has-inapp-ext-guide #selectionDock,
html.has-inapp-ext-guide #floatingFabWrap,
html.has-inapp-ext-guide #luxFloatingMobileRail {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.has-standalone-ext-scrim::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2147483640;
  pointer-events: auto;
}

.inapp-ext-guide .ieg-close-btn,
.android-gallery-guide .agg-close-btn {
  min-height: 44px;
  min-width: 68px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inapp-ext-guide .ieg-btn,
.android-gallery-guide .agg-next-btn,
.android-gallery-guide .agg-zip-link {
  min-height: 46px;
}

/* 3. Auto-Hide Floating `+` FAB When Selection Dock Is Active + Pad Gallery Body */
html.has-selection-dock #floatingFabWrap {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.88);
}

html.has-selection-dock #clientGalleryBody {
  padding-bottom: calc(var(--dock-offset, 210px) + 28px);
}

/* In Sandbox Lab, allow top Sandbox dev bar to scroll away naturally in Mode B */
body:has(#clientGalleryRoot:not([hidden])) .sf-sandbox-lab-bar {
  position: relative;
}

/* 4. Semantic Non-Nested Photo Card Controls + True 44×44px Hit Targets */
.photo-card-open-btn {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.photo-card-open-btn:focus-visible {
  outline: 3px solid var(--accent, #2563EB);
  outline-offset: -3px;
  border-radius: inherit;
}

/* `.photo-heart` keeps 100% clean original look (hidden until `.selecting` or `.selected`, 26×26px ring)
   while expanding its invisible touch area to 44×44px when active! */
button.photo-heart,
.photo-heart {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.photo-grid.selecting .photo-heart,
.photo-card.selected .photo-heart,
.photo-heart:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .photo-card:hover .photo-heart {
    opacity: 1;
    pointer-events: auto;
  }
}

.photo-heart-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.photo-card.selected .photo-heart {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.photo-card.selected .photo-heart-badge {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: scale(1.05);
}

/* `.photo-quick-dl`: Zero Ghost-Taps on Mobile (`pointer-events: none` unless hovered on desktop) */
button.photo-quick-dl,
.photo-quick-dl {
  position: absolute;
  bottom: 2px;
  right: 2px;
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  touch-action: manipulation;
  transition: opacity 0.16s ease, transform 0.15s ease;
}

.photo-qdl-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .photo-grid:not(.selecting) .photo-card:hover .photo-quick-dl,
  .photo-grid:not(.selecting) .photo-quick-dl:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .photo-quick-dl:hover .photo-qdl-badge {
    background: #1849D6;
    border-color: #60A5FA;
    transform: scale(1.06);
  }
}

/* Keyboard Focus Ring on Plan Choice Radio Cards */
.plan-choice-card[role="radio"] {
  cursor: pointer;
}

.plan-choice-card[role="radio"]:focus-visible {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}

/* Active state glow on BGM Autoplay Toggle Pill */
#btnClientBgmToggle.is-playing {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(110, 231, 183, 0.72);
  color: #FFFFFF;
}

/* =========================================================================
   5. HYBRID MOBILE ARCHITECTURE:
      - Top of Album = Image 1 (Original Full Layout, Non-Sticky `.gallery-toolbar`)
      - Scrolled Down / Selecting = Image 2 (`#luxFloatingMobileRail` Compact Pill Bar)
   ========================================================================= */

.lux-floating-mobile-rail {
  display: none;
}

@media (max-width: 767px) {
  /* Keep Image 1's full `.gallery-toolbar` at the top of the gallery WITHOUT sticking down over the photos! */
  html[data-hybrid-scroll-rail="1"] #clientGalleryRoot .gallery-toolbar,
  #clientGalleryRoot .gallery-toolbar {
    position: relative !important;
    top: auto !important;
  }

  /* Image 2 + Video 2: Compact 1-Row Spring-Morphing Floating Capsule Bar */
  html[data-hybrid-scroll-rail="1"] .lux-floating-mobile-rail {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 42;
    padding: 5px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    display: flex;
    gap: 5px;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s ease;
  }

  html[data-hybrid-scroll-rail="1"] .lux-floating-mobile-rail.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .lux-rail-btn {
    position: relative;
    flex: 1 1 0%;
    min-height: 44px;
    min-width: 44px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 12px;
    letter-spacing: -0.01em;
    font-weight: 600;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
      flex-grow 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      padding 0.26s cubic-bezier(0.22, 1, 0.36, 1),
      background-color 0.18s ease,
      color 0.18s ease,
      border-color 0.18s ease,
      transform 0.12s ease;
  }

  #btnLuxMobilePrimary {
    flex: 1.22 1 0%;
  }

  #btnLuxMobileSelect {
    flex: 0.88 1 0%;
  }

  #btnLuxMobileMore {
    flex: 1.12 1 0%;
  }

  /* When selecting photos, center pill smoothly expands ("กดแล้วขยายออกมา")! */
  .lux-floating-mobile-rail.is-selecting-mode #btnLuxMobilePrimary {
    flex: 1.05 1 0%;
  }

  .lux-floating-mobile-rail.is-selecting-mode #btnLuxMobileSelect {
    flex: 1.18 1 0%;
  }

  .lux-rail-btn:active {
    transform: scale(0.98);
  }

  .lux-rail-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
  }

  .lux-rail-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
  }

  .lux-rail-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lux-more-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--surface);
  }
}

/* =========================================================================
   6. VIEW & SHARE BOTTOM SHEET (`<dialog id="clientLuxuryToolsSheet">`)
      Opened when tapping `⋯ มุมมอง & แชร์` on the Image 2 Floating Bar
   ========================================================================= */

dialog.lux-tools-sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 540px;
  max-height: min(86dvh, 720px);
  padding: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  background: var(--surface, #FFFFFF);
  color: var(--ink, #0F172A);
  box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  font-family: inherit;
}

dialog.lux-tools-sheet:not([open]) {
  display: none !important;
}

dialog.lux-tools-sheet::backdrop {
  background: rgba(9, 13, 22, 0.56);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.lux-sheet-grabber {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted, #64748B) 38%, transparent);
  margin: 10px auto 2px;
}

.lux-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.lux-sheet-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.lux-sheet-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-alt, #F8FAFC);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.lux-sheet-scroll {
  overflow-y: auto;
  max-height: calc(min(86dvh, 720px) - 72px);
  padding: 14px 18px max(22px, calc(env(safe-area-inset-bottom) + 16px));
  display: grid;
  gap: 16px;
}

.lux-sheet-section {
  display: grid;
  gap: 8px;
}

.lux-sheet-kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.lux-sheet-primary-btn {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.lux-sheet-ai-btn {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.lux-sheet-ai-btn[hidden] {
  display: none !important;
}

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

.lux-sheet-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lux-sheet-btn {
  min-height: 46px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lux-sheet-btn.is-active,
.lux-sheet-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.lux-sheet-btn[hidden] {
  display: none !important;
}

.lux-sheet-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lux-sheet-pill {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.lux-sheet-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.lux-sheet-switch-row {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.lux-switch-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pill-track, #E2E8F0);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.lux-sheet-switch-row[aria-pressed="true"] .lux-switch-pill {
  background: #059669;
  color: #FFFFFF;
}

/* =========================================================================
   7. KONGBENG MORPHING ICON-TO-LABEL CAPSULES & CONTAINED POPOVER (`v3.3.4`)
      - Fixes Image 1: Zero horizontal scrolling / multi-row wrap on top bars
      - Fixes Image 3: Concise 1-line Thai `#ratioPopoverMenu` clamped in viewport
      - Implements Video 2: Inactive = Clean Icon · Active/Tapped = Smooth Expand!
   ========================================================================= */

.sf-m-ico {
  flex-shrink: 0;
}

/* Prevent base `.qfilter-pill span` badge rule from styling `.sf-m-lbl` text span */
.qfilter-pill > span.sf-m-lbl {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  color: inherit;
}

/* Ratio Popover Menu: Compact, crisp 1-line rows, zero horizontal overflow */
.ratio-popover-menu {
  min-width: 248px;
  width: max-content;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
}

.ratio-popover-item {
  white-space: nowrap;
  gap: 8px;
}

.ratio-popover-item > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767px) {
  /* A. Image 3 Fix: Anchor `#ratioPopoverMenu` cleanly inside mobile screen (`0px` overflow) */
  #clientGalleryRoot .ratio-popover-menu {
    left: auto;
    right: 0;
    min-width: 0;
    width: min(264px, calc(100vw - 28px));
    max-width: calc(100vw - 24px);
    max-height: min(82dvh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    gap: 1px;
    border-radius: 14px;
  }

  #clientGalleryRoot .ratio-popover-group-label {
    padding: 4px 10px 2px;
    font-size: 10.2px;
  }

  #clientGalleryRoot .ratio-popover-divider {
    margin: 3px 6px;
  }

  #clientGalleryRoot .ratio-popover-item {
    min-height: 31px;
    padding: 4px 10px;
    font-size: 12.2px;
  }

  #clientGalleryRoot .popover-gap-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 3px 4px 3px;
  }

  #clientGalleryRoot .popover-gap-btn {
    min-height: 30px;
    font-size: 12px;
    padding: 0 6px;
    white-space: nowrap;
  }

  /* B. Image 1 Hero Top Action Bar: Clean 1-Row Circular Icon Pills (Kongbeng Top-Right Style) */
  #clientHero .hero-top-bar {
    align-items: center;
    gap: 8px;
  }

  #clientHero .hero-top-bar > div:last-child {
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  #clientHero .sf-hero-icon-pill,
  #clientHero #btnHeroEyeCare {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0 !important;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-shrink: 0;
  }

  #clientHero .sf-hero-icon-pill[hidden],
  #clientHero #btnClientBgmToggle[hidden],
  #clientHero #clientContactBtn[hidden] {
    display: none !important;
  }

  #clientHero .sf-hero-icon-pill .sf-m-lbl,
  #clientHero #btnHeroEyeCare .eyecare-label {
    display: none;
  }

  #clientHero #btnHeroLangToggle {
    min-height: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    flex-shrink: 0;
  }

  #clientHero #btnHeroLangToggle .ico-globe {
    display: none;
  }

  #clientHero #btnClientBgmToggle {
    min-height: 38px;
    height: 38px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  /* C. Video 2 Signature: Kongbeng Morphing Quick Filter Capsule (`#clientQuickFilters`)
        - Inactive pills = Clean SVG icon (+ count badge on Heart)
        - Active pill = Smoothly expands horizontally ("กดแล้วขยายออกมา")! */
  #clientQuickFilters.quick-filter-pills {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 4px;
    width: auto;
    max-width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  }

  #clientQuickFilters .qfilter-pill.sf-morph-pill {
    min-height: 36px;
    min-width: 40px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    white-space: nowrap;
    transition:
      padding 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      background-color 0.22s ease,
      color 0.22s ease,
      border-color 0.22s ease;
  }

  #clientQuickFilters .qfilter-pill.sf-morph-pill[hidden] {
    display: none !important;
  }

  #clientQuickFilters .qfilter-pill.sf-morph-pill .sf-m-lbl {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    padding: 0 !important;
    background: transparent !important;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    transition:
      max-width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.2s ease,
      margin-left 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  }

  #clientQuickFilters .qfilter-pill.sf-morph-pill #favFilterCount {
    margin-left: 5px;
    font-size: 11.5px;
    font-weight: 700;
  }

  #clientQuickFilters .qfilter-pill.sf-morph-pill.active {
    padding: 0 14px;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  }

  #clientQuickFilters .qfilter-pill.sf-morph-pill.active .sf-m-lbl {
    max-width: 150px;
    opacity: 1;
    margin-left: 6px;
  }

  /* D. Active-Expanding Subfolder Tabs (`#clientFolderTabs` in Image 1) */
  #clientFolderTabs.folder-tabs {
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  #clientFolderTabs.folder-tabs::-webkit-scrollbar {
    display: none;
  }

  #clientFolderTabs .folder-tab {
    flex-shrink: 0;
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 7px 11px;
    font-size: 12px;
    transition:
      max-width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      padding 0.24s cubic-bezier(0.22, 1, 0.36, 1),
      background-color 0.2s ease,
      color 0.2s ease;
  }

  #clientFolderTabs .folder-tab.active {
    flex-shrink: 0;
    max-width: 280px;
    padding: 7px 14px;
  }

  /* E. Compact Inline `.gallery-toolbar` Secondary Utility Pills (Icon-first + Expand When Active!) */
  #clientGalleryRoot .gallery-toolbar .sf-toolbar-icon-pill,
  #clientGalleryRoot .gallery-toolbar #btnToolbarEyeCare {
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  #clientGalleryRoot .gallery-toolbar .sf-toolbar-icon-pill .sf-m-lbl,
  #clientGalleryRoot .gallery-toolbar #btnToolbarEyeCare .eyecare-label {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    transition:
      max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.2s ease,
      margin-left 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* When Info Overlay is active, smoothly expand `[ⓘ ข้อมูลภาพ]`! */
  #clientGalleryRoot .gallery-toolbar #btnToggleInfoOverlay.active-info {
    padding: 0 12px;
  }

  #clientGalleryRoot .gallery-toolbar #btnToggleInfoOverlay.active-info .sf-m-lbl {
    max-width: 110px;
    opacity: 1;
    margin-left: 6px;
  }

  /* Sync pill: compact dot + short label, zero wrap */
  #clientGalleryRoot .gallery-toolbar #btnRealtimeSync {
    padding: 0 10px;
    min-height: 38px;
    font-size: 12px;
  }

  /* Mode A Photographer Builder Topbar: Clean icon-compact utility buttons on mobile */
  #builderShell .topbar-actions #lblWorkspaceNight {
    display: none;
  }

  #builderShell .topbar-actions .btn-night-toggle {
    min-width: 38px;
    padding: 0 10px;
  }
}
