/* ARIOINTEL_THEME_MENU_PUBLISH_FIX_V3
   Explicitly versioned stylesheet loaded AFTER site.css.
   Preserves themes, theme switching, theme names, and language resources.
*/
html body #theme-picker.theme-picker > .theme-menu {
  box-sizing: border-box !important;
  width: min(320px, calc(100vw - 24px)) !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
  overflow-x: hidden !important;
  transform: translateX(var(--ario-menu-shift, 0px));
}
html body #theme-picker.theme-picker .theme-option {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  column-gap: 8px !important;
  text-align: start !important;
  white-space: normal !important;
}
html body #theme-picker.theme-picker .theme-option > span:first-child {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: calc(100% - 65px) !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
  unicode-bidi: plaintext;
}
html body #theme-picker.theme-picker .theme-option > .theme-swatches {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  margin-inline-start: 0 !important;
  margin-inline-end: 0 !important;
  white-space: nowrap !important;
}
html[dir="rtl"] body #theme-picker.theme-picker > .theme-menu {
  direction: rtl !important;
  text-align: right !important;
  left: 0 !important;
  right: auto !important;
}
html[dir="rtl"] body #theme-picker.theme-picker .theme-option {
  direction: rtl !important;
  text-align: right !important;
}
html[dir="ltr"] body #theme-picker.theme-picker > .theme-menu {
  direction: ltr !important;
  text-align: left !important;
  left: auto !important;
  right: 0 !important;
}
@media (max-width: 700px) {
  html body #theme-picker.theme-picker > .theme-menu,
  html[dir="rtl"] body #theme-picker.theme-picker > .theme-menu,
  html[dir="ltr"] body #theme-picker.theme-picker > .theme-menu {
    position: fixed !important;
    left: 50vw !important;
    right: auto !important;
    top: 126px !important;
    transform: translateX(calc(-50% + var(--ario-menu-shift, 0px))) !important;
    width: min(320px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 142px) !important;
  }
}

/* ARIOINTEL_THEME_MENU_ALIGNED_V4
   Names at inline-start, swatches at inline-end; content-sized menu with
   viewport cap. RTL reverses sides naturally. Loaded after V3 baseline.
*/
html body #theme-picker.theme-picker > .theme-menu {
  width: max-content !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
  padding: 10px !important;
  overflow-x: hidden !important;
}
html body #theme-picker.theme-picker .theme-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  gap: 14px !important;
  padding-inline-start: 28px !important; /* reserve room for selected check */
  padding-inline-end: 9px !important;
  text-align: start !important;
  direction: inherit !important;
}
html body #theme-picker.theme-picker .theme-option[aria-pressed="true"]::before {
  position: absolute !important;
  inset-inline-start: 9px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  pointer-events: none !important;
}
html body #theme-picker.theme-picker .theme-option > span:first-child {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  text-align: start !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}
html body #theme-picker.theme-picker .theme-option > .theme-swatches {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  margin: 0 !important;
  margin-inline-start: auto !important;
  white-space: nowrap !important;
}
/* Keep existing V3 direction-specific popup anchors; change only width. */
html[dir="rtl"] body #theme-picker.theme-picker > .theme-menu,
html[dir="ltr"] body #theme-picker.theme-picker > .theme-menu {
  width: max-content !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
}
@media (max-width: 700px) {
  html body #theme-picker.theme-picker > .theme-menu,
  html[dir="rtl"] body #theme-picker.theme-picker > .theme-menu,
  html[dir="ltr"] body #theme-picker.theme-picker > .theme-menu {
    width: max-content !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
  }
  html body #theme-picker.theme-picker .theme-option > span:first-child {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

/* ARIOINTEL_THEME_MENU_COMPACT_V5
   Retain opposite-edge alignment and content-based width from V4.
   Reduce excess gutter and swatch footprint without clipping long names.
*/
html body #theme-picker.theme-picker > .theme-menu {
  width: max-content !important;
  min-width: 0 !important;
  max-width: min(275px, calc(100vw - 20px)) !important;
  padding: 7px !important;
}
html body #theme-picker.theme-picker .theme-option {
  gap: 8px !important;
  padding-inline-start: 19px !important;
  padding-inline-end: 5px !important;
}
html body #theme-picker.theme-picker .theme-option[aria-pressed="true"]::before {
  inset-inline-start: 4px !important;
}
html body #theme-picker.theme-picker .theme-option > span:first-child {
  white-space: normal !important;
  overflow-wrap: normal !important;
}
html body #theme-picker.theme-picker .theme-option > .theme-swatches {
  gap: 3px !important;
  padding: 2px !important;
}
html body #theme-picker.theme-picker .theme-option > .theme-swatches i {
  width: 15px !important;
  height: 15px !important;
}
html[dir="rtl"] body #theme-picker.theme-picker > .theme-menu,
html[dir="ltr"] body #theme-picker.theme-picker > .theme-menu {
  width: max-content !important;
  max-width: min(275px, calc(100vw - 20px)) !important;
}
@media (max-width: 700px) {
  html body #theme-picker.theme-picker > .theme-menu,
  html[dir="rtl"] body #theme-picker.theme-picker > .theme-menu,
  html[dir="ltr"] body #theme-picker.theme-picker > .theme-menu {
    width: max-content !important;
    max-width: calc(100vw - 20px) !important;
    padding: 7px !important;
  }
  html body #theme-picker.theme-picker .theme-option > span:first-child {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}
