.custom-header .custom-nav {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin-inline: 16px;
}

.custom-header .custom-nav-list {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
  justify-content: safe center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.custom-header .custom-nav-list::-webkit-scrollbar {
  display: none;
}

.custom-header .custom-nav-item {
  flex: 1 0 132px;
  min-width: 132px;
  max-width: 168px;
  box-sizing: border-box;
  margin: 0;
}

.custom-header .custom-nav .custom-nav-btn {
  position: relative;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 22px 24px;
  align-items: center;
  justify-items: center;
  justify-content: center;
  gap: 0px;
  width: 100%;
  height: 100%;
  min-height: 56px;
  box-sizing: border-box;
  padding: 4px;
  padding-top: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--bs-text-muted);
  font-family: inherit;
  letter-spacing: 0;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.custom-header .custom-nav .custom-nav-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  flex-shrink: 0;
  color: inherit;
}

.custom-header .custom-nav-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
  height: 24px;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  line-height: 12px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  letter-spacing: 0;
  transition: color 180ms ease;
  align-content: center;
}

.custom-header .custom-nav-item.active::after,
.custom-header .custom-nav .custom-nav-btn::after {
  content: none;
  display: none;
}

.custom-header .custom-nav .custom-nav-btn:hover {
  background: var(--bs-muted-bg);
}

.custom-header .custom-nav-item.active .custom-nav-btn {
  background: transparent;
  color: var(--bs-main-700);
  border: 0;
}

.custom-header .custom-nav-item.active .custom-nav-label {
  font-weight: 600;
}

.custom-header .custom-nav .custom-nav-btn::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: auto;
  bottom: -1px;
  left: 50%;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transform: translateX(-50%) scaleX(0.4);
  transition:
    opacity 200ms ease,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.custom-header .custom-nav-item.active .custom-nav-btn::before {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.custom-header .custom-left-header {
  flex: 0 1 auto;
  min-width: 0;
}

.custom-header .custom-search-container {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 220px;
  min-width: 0;
  height: 36px;
  padding: 0;
  gap: 0;
  border-radius: 0;
  background: transparent;
}

.custom-header .custom-right-header {
  margin-left: 0;
}

.custom-more-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bs-muted-bg);
  color: var(--bs-text);
  font-size: 18px;
}

.custom-more-btn:hover,
.custom-more-btn[aria-expanded="true"] {
  background: var(--bs-main-light);
  color: var(--bs-main);
}

.custom-right-header .custom-clock-btn[hidden],
.custom-right-header .pos-mode-switch[hidden] {
  display: none;
}

@property --pos-reveal {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.pos-mode-switch {
  --switch-pad: 3px;
  --switch-thumb: 30px;
  --switch-width: 64px;
  --switch-spring: cubic-bezier(0.34, 1.32, 0.5, 1);
  gap: 0;
  position: relative;
  display: inline-grid;
  flex: 0 0 var(--switch-width);
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: var(--switch-width);
  height: calc(var(--switch-thumb) + var(--switch-pad) * 2);
  padding: var(--switch-pad);
  border: 0;
  border-radius: 999px;
  background: var(--pos-canvas, #f1f3f5);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pos-text, #263238) 9%, transparent);
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 300ms ease, box-shadow 300ms ease;
}

.pos-mode-switch:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pos-text, #263238) 16%, transparent);
}

.pos-mode-switch:focus-visible {
  outline: 2px solid var(--pos-primary, var(--bs-main));
  outline-offset: 2px;
}

.pos-mode-switch__thumb {
  position: absolute;
  top: var(--switch-pad);
  left: var(--switch-pad);
  z-index: -1;
  width: var(--switch-thumb);
  height: var(--switch-thumb);
  border-radius: 999px;
  background: var(--pos-surface, #fff);
  box-shadow: 0 1px 2px rgb(15 23 42 / 14%), 0 3px 8px rgb(15 23 42 / 10%);
  transition: transform 560ms var(--switch-spring), width 220ms ease, background-color 300ms ease;
}

.pos-mode-switch:active .pos-mode-switch__thumb {
  width: calc(var(--switch-thumb) + 6px);
}

html[data-pos-appearance="dark"] .pos-mode-switch {
  background: color-mix(in srgb, var(--pos-surface2, #1b222b) 80%, #fff 4%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%);
}

html[data-pos-appearance="dark"] .pos-mode-switch:hover {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%);
}

html[data-pos-appearance="dark"] .pos-mode-switch__thumb {
  background: #3a4553;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 14%), inset 0 1px 0 rgb(255 255 255 / 10%), 0 2px 6px rgb(0 0 0 / 50%);
  transform: translateX(calc(var(--switch-width) - var(--switch-thumb) - var(--switch-pad) * 2));
}

html[data-pos-appearance="dark"] .pos-mode-switch:active .pos-mode-switch__thumb {
  transform: translateX(calc(var(--switch-width) - var(--switch-thumb) - var(--switch-pad) * 2 - 6px));
}

.pos-mode-switch__icon {
  justify-self: center;
  width: 18px;
  height: 18px;
  overflow: visible;
  color: color-mix(in srgb, var(--pos-text, #263238) 50%, transparent);
  transition: color 300ms ease, transform 640ms var(--switch-spring);
}

.pos-mode-switch:hover .pos-mode-switch__icon {
  color: color-mix(in srgb, var(--pos-text, #263238) 75%, transparent);
}

/* Inactive icons keep full size so strokes stay crisp; only rotation animates. */
.pos-mode-switch__icon--sun {
  transform: rotate(-90deg);
}

.pos-mode-switch__icon--moon {
  transform: rotate(28deg);
}

html[data-pos-appearance="dark"] .pos-mode-switch__icon {
  color: rgb(255 255 255 / 55%);
}

html[data-pos-appearance="dark"] .pos-mode-switch:hover .pos-mode-switch__icon {
  color: rgb(255 255 255 / 80%);
}

html:not([data-pos-appearance="dark"]) .pos-mode-switch__icon--sun,
html[data-pos-appearance="dark"] .pos-mode-switch__icon--moon {
  opacity: 1;
  transform: none;
}

html:not([data-pos-appearance="dark"]) .pos-mode-switch__icon--sun {
  color: #f59e0b;
}

html[data-pos-appearance="dark"] .pos-mode-switch__icon--moon,
html[data-pos-appearance="dark"] .pos-mode-switch:hover .pos-mode-switch__icon--moon {
  color: #e0e7ff;
}

html:not([data-pos-appearance="dark"]) .pos-mode-switch:hover .pos-mode-switch__icon--sun {
  color: #f59e0b;
}

.pos-mode-switch__rays {
  transform-box: view-box;
  transform-origin: 12px 12px;
  transition: transform 640ms var(--switch-spring);
}

html[data-pos-appearance="dark"] .pos-mode-switch__rays {
  transform: rotate(45deg);
}

.pos-mode-switch__spark {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: scale(0) rotate(-90deg);
  transition: opacity 200ms ease, transform 420ms var(--switch-spring);
}

html[data-pos-appearance="dark"] .pos-mode-switch__spark {
  opacity: 1;
  transform: none;
  transition-delay: 180ms;
}

html[data-pos-appearance="dark"] .pos-mode-switch__spark + .pos-mode-switch__spark {
  transition-delay: 300ms;
}

/* The page is captured once per switch; freezing other transitions keeps the snapshot crisp. */
html.pos-theme-switching *:not(.pos-mode-switch, .pos-mode-switch *),
html.pos-theme-switching *::before,
html.pos-theme-switching *::after {
  transition: none !important;
}

html.pos-theme-switching::view-transition-group(root) {
  animation-duration: 700ms;
}

html.pos-theme-switching::view-transition-old(root) {
  animation: none;
  mix-blend-mode: normal;
}

html.pos-theme-switching::view-transition-new(root) {
  mix-blend-mode: normal;
  -webkit-mask-image: radial-gradient(circle at var(--pos-reveal-x, 50%) var(--pos-reveal-y, 0px),
      #000 var(--pos-reveal), transparent calc(var(--pos-reveal) + 96px));
  mask-image: radial-gradient(circle at var(--pos-reveal-x, 50%) var(--pos-reveal-y, 0px),
      #000 var(--pos-reveal), transparent calc(var(--pos-reveal) + 96px));
  animation: pos-theme-reveal 700ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes pos-theme-reveal {
  from {
    --pos-reveal: 0px;
  }
  to {
    --pos-reveal: var(--pos-reveal-r, 150vmax);
  }
}

html.pos-theme-fading *:not(.pos-mode-switch, .pos-mode-switch *) {
  transition: background-color 320ms ease, border-color 320ms ease, color 320ms ease, fill 320ms ease !important;
}

@media (max-width: 768px) {
  .pos-mode-switch {
    --switch-thumb: 26px;
    --switch-width: 56px;
  }

  .pos-mode-switch__icon {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pos-mode-switch,
  .pos-mode-switch * {
    transition: none !important;
  }
}

.more-menu-popup {
  --more-tone-navigation: #219c90;
  --more-tone-operations: #ff9800;
  --more-tone-management: #ff9eaa;
  --more-tone-configuration: #181d31;
  --more-tone-danger: #ff6363;
  --more-menu-surface-shadow: 0 1px 4px rgb(0 0 0 / 15%), 0 4px 12px rgb(0 0 0 / 8%);
  position: fixed;
  right: 12px;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  width: 640px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  overflow: hidden;
  background: #f8f9fb;
  color: var(--bs-text);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  box-shadow:
    0 16px 48px rgb(0 0 0 / 22%),
    0 2px 8px rgb(0 0 0 / 12%);
  font-family: inherit;
  letter-spacing: 0;
}

.menu-shell-popup {
  position: fixed;
  right: 12px;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  width: 640px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  overflow: hidden;
  background: #f8f9fb;
  color: var(--bs-text);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  box-shadow:
    0 16px 48px rgb(0 0 0 / 22%),
    0 2px 8px rgb(0 0 0 / 12%);
  font-family: inherit;
  letter-spacing: 0;
}

.menu-shell-popup[hidden],
.menu-shell-popup [hidden] {
  display: none !important;
}

.menu-shell-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 12px 16px 8px;
}

.menu-shell-header h2 {
  margin: 0;
  color: var(--bs-heading-color);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.menu-shell-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bs-text-muted);
  font-size: 16px;
}

.menu-shell-close:hover {
  color: var(--bs-main);
  background: var(--bs-main-light);
}

.menu-shell-popup.menu-shell-close-outside {
  overflow: visible;
}

.menu-shell-popup.menu-shell-close-outside > .menu-shell-header {
  border-radius: 8px 8px 0 0;
}

.menu-shell-popup.menu-shell-close-outside > .menu-shell-footer {
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.menu-shell-popup.menu-shell-close-outside > .menu-shell-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: -48px;
  width: 40px;
  height: 40px;
  border: 1px solid #d3d3d3;
  border-radius: 50%;
  background: #fff;
  color: #9ca3af;
  font-size: 18px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
  pointer-events: auto;
}

.menu-shell-popup.menu-shell-close-outside > .menu-shell-close:hover {
  background: #fff;
  color: var(--bs-text);
}

.menu-shell-popup.menu-shell-close-outside > .menu-shell-close:focus-visible {
  outline: 2px solid var(--bs-main);
  outline-offset: 3px;
}

.menu-shell-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 16px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.menu-shell-content {
  min-width: 0;
  padding: 12px;
  background: var(--bs-surface-bg);
  border-radius: 8px;
  box-shadow:
    0 1px 4px rgb(0 0 0 / 15%),
    0 4px 12px rgb(0 0 0 / 8%);
}

.menu-shell-footer {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-surface-bg);
}

.menu-shell-status {
  margin: 0;
  min-height: 16px;
  padding: 0 16px 12px;
  color: var(--bs-text-muted);
  font-size: 12px;
}

#static-clockinout-tech-modal.manage-attendance-shell > .menu-shell-header {
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid var(--bs-border-color);
}

#static-clockinout-tech-modal.manage-attendance-shell > .menu-shell-header h2 {
  color: var(--bs-text);
  font-size: 18px;
  line-height: 24px;
}

#static-clockinout-tech-modal.manage-attendance-shell .menu-shell-body {
  padding: 0;
  overflow: hidden;
}

#static-clockinout-tech-modal.manage-attendance-shell .menu-shell-content {
  height: 100%;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

#static-clockinout-tech-modal.manage-attendance-shell .header-clock {
  display: none;
}

.more-menu-popup[hidden],
.more-menu-popup [hidden] {
  display: none !important;
}

.more-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 12px 16px 8px;
}

.more-menu-header h2 {
  margin: 0;
  color: var(--bs-heading-color);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.more-menu-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.more-menu-edit,
.more-menu-close,
.more-menu-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bs-text-muted);
  font-size: 16px;
}

.more-menu-popup:not(.is-editing) .more-menu-pin {
  display: none;
}

.more-menu-edit:hover,
.more-menu-edit[aria-pressed="true"] {
  background: var(--bs-main-light);
  color: var(--bs-main);
}

.more-menu-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 196px;
  gap: 12px;
  min-height: 0;
  padding: 4px 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.more-menu-directory {
  min-width: 0;
  padding: 12px;
  background: var(--bs-surface-bg);
  /* border: 1px solid var(--bs-border-calendar); */
  border-radius: 8px;
  box-shadow: var(--more-menu-surface-shadow);
}

.more-menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: var(--bs-muted-bg);
  color: var(--bs-text-muted);
  font-size: 13px;
}

.more-menu-search:focus-within {
  border-color: var(--bs-main);
}

.more-menu-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--bs-text);
  font: inherit;
}

.more-menu-group + .more-menu-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bs-border-color);
}

.more-menu-group h3,
.more-menu-pinned h3 {
  margin: 8px 0 12px;
  color: var(--bs-heading-color);
  font-size: 15px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.more-menu-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  border-radius: 6px;
}

.more-menu-row:hover,
.more-menu-pinned-list .more-menu-action:hover,
.more-menu-account .more-menu-action:hover,
.more-menu-close:hover {
  background: var(--bs-muted-bg);
}

.more-menu-popup .more-menu-action {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  flex: 1;
  gap: 10px;
  min-width: 0;
  height: auto;
  min-height: 48px;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bs-text);
  text-align: left;
  font-family: inherit;
}

.more-menu-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.more-menu-label {
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.more-menu-description {
  color: var(--bs-text-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
  overflow-wrap: anywhere;
}

.more-menu-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.more-menu-popup .more-menu-action .setting-icon-container {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 16px;
  color: var(--bs-text-muted);
  background: var(--bs-muted-bg) !important;
}

.more-menu-popup .more-menu-action .setting-icon-container i {
  font-weight: 400;
}

/* Inline SVG icons (MoreMenu.svgIcons) sized like a Font Awesome glyph. */
.more-menu-svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

.more-menu-svg-icon svg {
  display: block;
  width: 1em;
  height: 1em;
}

.more-menu-popup [data-more-action="settings"] .setting-icon-container {
  color: var(--bs-main);
  background: var(--bs-main-100);
}

.more-menu-popup [data-more-group="Navigation"] .setting-icon-container {
  color: var(--more-tone-navigation);
  background: color-mix(in srgb, var(--more-tone-navigation) 14%, var(--bs-surface-bg));
}

.more-menu-popup [data-more-group="Daily Operations"] .setting-icon-container {
  color: var(--more-tone-operations);
  background: color-mix(in srgb, var(--more-tone-operations) 14%, var(--bs-surface-bg));
}

.more-menu-popup [data-more-group="Management"] .setting-icon-container {
  color: color-mix(in srgb, var(--more-tone-danger) 74%, var(--more-tone-management));
  background: color-mix(in srgb, var(--more-tone-management) 24%, var(--bs-surface-bg));
}

.more-menu-popup
  [data-more-group="Configuration"]:not([data-more-action="settings"])
  .setting-icon-container {
  color: color-mix(in srgb, var(--more-tone-navigation) 70%, var(--more-tone-configuration));
  background: color-mix(in srgb, var(--more-tone-navigation) 18%, var(--bs-surface-bg));
}

.more-menu-popup [data-more-action="logout"] .setting-icon-container {
  color: var(--more-tone-danger);
  background: color-mix(in srgb, var(--more-tone-danger) 12%, var(--bs-surface-bg));
}

.more-menu-account [data-more-action="settings"] .more-menu-label {
  font-weight: 600;
}

.more-menu-pin[aria-pressed="true"],
.more-menu-pin:not(:disabled):hover {
  color: var(--bs-main);
  background: var(--bs-gray-100);
}

.more-menu-pin {
  color: var(--bs-text-muted);
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.more-menu-pin-glyph {
  width: 18px;
  height: 18px;
  display: block;
  transform-origin: center;
  transform-box: fill-box;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 16%));
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    filter 180ms ease;
}

.more-menu-pin-stick {
  fill: var(--bs-gray-500);
  transition: fill 180ms ease;
}

.more-menu-pin-core {
  fill: var(--accent-red);
  transition: fill 180ms ease;
}

.more-menu-pin:not([aria-pressed="true"]) .more-menu-pin-glyph,
.more-menu-pin:not([aria-pressed="true"]) i {
  transform: unset;
  opacity: 1;
}

.more-menu-pin:not([aria-pressed="true"]) .more-menu-pin-core {
  fill: var(--bs-gray-500);
}

.more-menu-pin[aria-pressed="true"] .more-menu-pin-glyph,
.more-menu-pin[aria-pressed="true"] i {
  transform: rotate(-45deg);
  opacity: 1;
}

.more-menu-pin[aria-pressed="true"] .more-menu-pin-stick,
.more-menu-pin:not(:disabled):hover .more-menu-pin-stick {
  fill: #7f7f7f;
}

.more-menu-pin[aria-pressed="true"] .more-menu-pin-core,
.more-menu-pin:not(:disabled):hover .more-menu-pin-core {
  fill: var(--accent-red);
}

.more-menu-pin:not(:disabled):hover .more-menu-pin-glyph {
  filter: drop-shadow(0 2px 3px rgb(255 151 102 / 35%));
}

.more-menu-pin.is-pin-success {
  animation: more-menu-pin-pulse 360ms ease-out;
}

.more-menu-pin.is-pin-success .more-menu-pin-glyph,
.more-menu-pin.is-pin-success i {
  animation: more-menu-pin-pop 360ms cubic-bezier(0.2, 0.9, 0.28, 1);
}

.more-menu-pin:disabled {
  opacity: 1;
  cursor: not-allowed;
}

@keyframes more-menu-pin-pop {
  0% {
    transform: none;
  }
  30% {
    transform: scale(1.22);
  }
  65% {
    transform: scale(0.92);
  }
  100% {
    transform: none;
  }
}

@keyframes more-menu-pin-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(58 152 33 / 34%);
  }
  100% {
    box-shadow: 0 0 0 10px rgb(58 152 33 / 0%);
  }
}

.more-menu-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-width: 0;
}

.more-menu-pinned {
  min-width: 0;
  padding: 12px 8px;
  background: var(--bs-surface-bg);
  /* border: 1px solid var(--bs-border-color); */
  border-radius: 8px;
  box-shadow: var(--more-menu-surface-shadow);
}

.more-menu-pinned-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.more-menu-pin-count {
  flex-shrink: 0;
  color: var(--bs-text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.more-menu-pinned-list .more-menu-action,
.more-menu-account .more-menu-action {
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr);
}

.more-menu-popup .more-menu-pinned-list .setting-icon-container,
.more-menu-popup .more-menu-account .setting-icon-container {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.more-menu-account {
  margin-top: 12px;
  padding: 8px 9px 0;
  border-top: 1px solid var(--bs-border-color);
}

.more-menu-empty,
.more-menu-pinned-empty,
.more-menu-status {
  margin: 8px 4px;
  color: var(--bs-text-muted);
  font-size: 12px;
  line-height: 18px;
}

.more-menu-status:empty {
  display: none;
}

.more-menu-status {
  padding: 0 12px 8px;
}

.custom-more-btn:focus-visible,
.more-menu-popup button:focus-visible,
.custom-header .custom-nav-btn:focus-visible {
  outline: 2px solid var(--bs-main);
  outline-offset: -2px;
}

@media (min-width: 769px) {
  body:has(.custom-header) {
    --custom-height: 64px;
    --top-popup: 64px;
  }

  .custom-header {
    flex: 0 0 64px;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    box-sizing: border-box;
  }

  .custom-header .custom-nav,
  .custom-header .custom-nav-list,
  .custom-header .custom-nav-item {
    height: 100%;
    min-height: 100%;
  }

  .custom-header .custom-nav-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 136px);
    gap: 8px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
  }

  .custom-header .custom-nav-item {
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 1100px) {
  .custom-header .custom-search-container {
    display: none;
  }

  .custom-header .custom-mobile-search-btn {
    display: flex;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .custom-header .custom-nav {
    margin-inline: 8px;
  }
}

@media (max-width: 768px) {
  :root {
    --mobile-nav-height: 60px;
  }

  .custom-header .custom-nav {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: var(--mobile-bottom-inset);
    margin: 0;
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px)
      max(4px, env(safe-area-inset-left, 0px));
    border-radius: 0;
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -2px 10px rgb(0 0 0 / 3%);
  }

  .custom-header .custom-right-header {
    margin-left: auto;
  }

  .custom-header .custom-nav-list {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    height: var(--mobile-nav-height);
    min-width: 0;
    gap: 0px;
    padding-block: 4px;
    box-sizing: border-box;
    overflow: visible;
    padding: 0;
  }

  .custom-header .custom-nav-item {
    min-width: 0;
    max-width: none;
    height: 100%;
    overflow: visible;
  }

  .custom-header .custom-nav .custom-nav-btn {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 22px 24px;
    justify-items: center;
    align-content: center;
    height: 100%;
    min-height: 56px;
    min-width: 0;
    gap: 0;
    padding: 0;
    padding-top: 10px;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
      background-color 200ms ease,
      color 180ms ease,
      transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .custom-header .custom-nav .custom-nav-btn:hover {
    background: transparent;
  }

  .custom-header .custom-nav-item.active .custom-nav-btn {
    background: color-mix(in srgb, var(--bs-main) 6%, #f1faca7a);
    background: 0;
    border-radius: 8px 8px 0 0;
    border: 0;
  }

  .custom-header .custom-nav .custom-nav-btn::before {
    top: -1px;
    bottom: unset;
  }

  .custom-header .custom-nav .custom-nav-btn:active {
    transform: scale(0.96);
    transition-duration: 90ms;
  }

  .custom-header .custom-nav-label {
    position: relative;
    width: 100%;
    min-height: 0;
    font-size: 9px;
    text-align: center;
    font-weight: 600;
  }

  .custom-header .custom-nav .custom-nav-btn i {
    position: relative;
    width: 22px;
    height: 22px;
    font-size: 20px;
    line-height: 22px;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .custom-header .custom-nav-item.active .custom-nav-btn i {
    transform: none;
  }

  #container-swift-operation-id > .swift-general:not(.dis-none) {
    animation: custom-nav-page-enter 180ms ease-out;
  }

  .custom-more-btn {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

@keyframes custom-nav-page-enter {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  body .more-menu-popup {
    inset: 0 0 auto;
    z-index: 1056;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    border: 0;
    border-radius: 0;
    animation: more-menu-slide-up 180ms ease-out;
  }

  body .more-menu-popup .more-menu-header {
    min-height: 64px;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px
      max(16px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-surface-bg);
  }

  body .more-menu-popup .more-menu-edit,
  body .more-menu-popup .more-menu-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  body .more-menu-popup .more-menu-close {
    background: var(--bs-muted-bg);
  }

  body .more-menu-popup .more-menu-body {
    flex: 1 1 auto;
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px max(12px, env(safe-area-inset-right, 0px)) 16px
      max(12px, env(safe-area-inset-left, 0px));
  }

  body .more-menu-popup .more-menu-pinned {
    display: none;
  }

  body .more-menu-popup .more-menu-sidebar {
    position: static;
    order: -1;
  }

  body .more-menu-popup .more-menu-account {
    margin-top: 0;
    padding: 0 4px 12px;
    border-top: 0;
    border-bottom: 1px solid var(--bs-border-color);
  }

  body .more-menu-popup .more-menu-search input {
    font-size: 16px;
  }

  body .more-menu-popup .more-menu-pin {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  body .menu-shell-popup {
    inset: 0 0 auto;
    z-index: 1056;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    border: 0;
    border-radius: 0;
    animation: more-menu-slide-up 180ms ease-out;
  }

  body .menu-shell-popup .menu-shell-header {
    min-height: 64px;
    gap: 12px;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px
      max(16px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-surface-bg);
  }

  body .menu-shell-popup .menu-shell-header h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body .menu-shell-popup .menu-shell-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    background: var(--bs-muted-bg);
  }

  body .menu-shell-popup .menu-shell-body {
    padding: 16px max(12px, env(safe-area-inset-right, 0px)) 16px
      max(12px, env(safe-area-inset-left, 0px));
  }

  body .menu-shell-popup .menu-shell-footer {
    max-height: 50dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-wrap: wrap;
    padding: 10px max(12px, env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }

  body:has(.more-menu-popup:not([hidden])),
  body:has(.menu-shell-popup:not([hidden])) {
    overflow: hidden;
  }
}

@keyframes more-menu-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .more-menu-pin,
  .more-menu-pin-glyph {
    transition: none !important;
  }

  .more-menu-pin.is-pin-success,
  .more-menu-pin.is-pin-success .more-menu-pin-glyph,
  .more-menu-pin.is-pin-success i {
    animation: none !important;
  }

  body .more-menu-popup {
    animation: none !important;
  }

  .custom-header .custom-nav .custom-nav-btn,
  .custom-header .custom-nav .custom-nav-btn::before,
  .custom-header .custom-nav .custom-nav-btn i,
  .custom-header .custom-nav .custom-nav-btn i::before,
  .custom-header .custom-nav-label {
    transition: none !important;
  }

  .custom-header .custom-nav .custom-nav-btn:active,
  .custom-header .custom-nav-item.active .custom-nav-btn i {
    transform: none;
  }

  #container-swift-operation-id > .swift-general:not(.dis-none) {
    animation: none !important;
  }
}

@media (max-height: 600px) {
  .more-menu-sidebar {
    position: static;
  }
}

@media (max-width: 600px) {
  .more-menu-popup {
    right: 8px;
    width: calc(100vw - 16px);
    max-width: none;
  }

  .more-menu-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 8px 8px;
  }

  .more-menu-pinned {
    display: none;
  }

  .more-menu-sidebar {
    position: static;
  }

  .more-menu-account {
    margin-top: 0;
  }

  .more-menu-header {
    padding: 8px 12px;
  }

  .more-menu-pin {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .menu-shell-popup {
    right: 8px;
    width: calc(100vw - 16px);
    max-width: none;
  }

  .menu-shell-header {
    padding: 8px 12px;
  }

  .menu-shell-body {
    padding: 0 8px 8px;
  }
}
