/* MeloTools clean navigation — balanced category index and wrapped tool list. */
html[data-ui-theme="saas"] .nav-shell {
  display: grid !important;
  gap: 9px !important;
  width: min(100%, 1040px) !important;
  margin: 0 auto 22px !important;
}

html[data-ui-theme="saas"] .nav-rail-label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 18px !important;
  padding: 0 2px !important;
}

html[data-ui-theme="saas"] .nav-rail-label strong {
  color: #6b7f91 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}

html[data-ui-theme="saas"] .nav-rail-label span {
  display: none !important;
}

html[data-ui-theme="saas"] .nav-rail-label-tools {
  margin-top: 7px !important;
  padding-top: 12px !important;
  border-top: 1px solid #e4ebf1 !important;
}

html[data-ui-theme="saas"] #mainTabs.main-tabs {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 4px !important;
  border: 1px solid #dce5ed !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(25, 52, 75, .035) !important;
  overflow: visible !important;
}

html[data-ui-theme="saas"] #mainTabs .main-tab {
  display: inline-flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  padding: 10px 11px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #42586b !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  white-space: normal !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-ui-theme="saas"] #mainTabs .main-tab-icon {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.75 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  opacity: .62 !important;
}

html[data-ui-theme="saas"] #mainTabs .main-tab:hover {
  border-color: transparent !important;
  background: #f3f7fa !important;
  color: #1d3549 !important;
  box-shadow: none !important;
}

html[data-ui-theme="saas"] #mainTabs .main-tab.active {
  border-color: #1769d2 !important;
  background: #1769d2 !important;
  color: #fff !important;
  box-shadow: none !important;
}

html[data-ui-theme="saas"] #mainTabs .main-tab.active .main-tab-icon {
  opacity: .88 !important;
}

html[data-ui-theme="saas"] #toolTabs.tool-tabs,
html[data-ui-theme="saas"] body.mt-category-media #toolTabs.tool-tabs {
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

html[data-ui-theme="saas"] #toolTabs .tool-tab,
html[data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 39px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 9px 14px !important;
  border: 1px solid #dce5ed !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #496075 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-ui-theme="saas"] #toolTabs .tool-tab:hover,
html[data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab:hover {
  border-color: #b9c9d8 !important;
  background: #f8fafc !important;
  color: #233e54 !important;
  box-shadow: none !important;
}

html[data-ui-theme="saas"] #toolTabs .tool-tab.active,
html[data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab.active {
  border-color: #8fb6e8 !important;
  background: #edf5ff !important;
  color: #1557a5 !important;
  box-shadow: inset 0 0 0 1px rgba(23, 105, 210, .04) !important;
}

html[data-ui-theme="saas"] #mainTabs .main-tab:focus-visible,
html[data-ui-theme="saas"] #toolTabs .tool-tab:focus-visible {
  outline: 3px solid rgba(23, 105, 210, .24) !important;
  outline-offset: 2px !important;
}

html[data-theme="dark"][data-ui-theme="saas"] .nav-rail-label strong {
  color: #8fa4b6 !important;
}

html[data-theme="dark"][data-ui-theme="saas"] .nav-rail-label-tools {
  border-top-color: #243647 !important;
}

html[data-theme="dark"][data-ui-theme="saas"] #mainTabs.main-tabs {
  border-color: #26394a !important;
  background: #0c1721 !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025) inset !important;
}

html[data-theme="dark"][data-ui-theme="saas"] #mainTabs .main-tab {
  color: #b6c6d4 !important;
}

html[data-theme="dark"][data-ui-theme="saas"] #mainTabs .main-tab:hover {
  background: #142534 !important;
  color: #eef5fb !important;
}

html[data-theme="dark"][data-ui-theme="saas"] #mainTabs .main-tab.active {
  border-color: #2f78ca !important;
  background: #1b5fa9 !important;
  color: #fff !important;
}

html[data-theme="dark"][data-ui-theme="saas"] #toolTabs .tool-tab,
html[data-theme="dark"][data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab {
  border-color: #2a3d4e !important;
  background: #0e1b27 !important;
  color: #b8c8d6 !important;
}

html[data-theme="dark"][data-ui-theme="saas"] #toolTabs .tool-tab:hover,
html[data-theme="dark"][data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab:hover {
  border-color: #405a70 !important;
  background: #142635 !important;
  color: #eef5fb !important;
}

html[data-theme="dark"][data-ui-theme="saas"] #toolTabs .tool-tab.active,
html[data-theme="dark"][data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab.active {
  border-color: #3979bd !important;
  background: #133658 !important;
  color: #a9d2ff !important;
}

@media (max-width: 900px) {
  html[data-ui-theme="saas"] #mainTabs.main-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  html[data-ui-theme="saas"] .nav-shell {
    gap: 8px !important;
    margin-bottom: 18px !important;
  }

  html[data-ui-theme="saas"] #mainTabs.main-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 3px !important;
    border-radius: 13px !important;
  }

  html[data-ui-theme="saas"] #mainTabs .main-tab {
    min-height: 44px !important;
    padding: 9px 10px !important;
    font-size: 12px !important;
  }

  html[data-ui-theme="saas"] #toolTabs .tool-tab,
  html[data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab {
    flex: 0 0 calc(50% - 4px) !important;
    width: calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    padding-inline: 9px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 340px) {
  html[data-ui-theme="saas"] #toolTabs .tool-tab,
  html[data-ui-theme="saas"] body.mt-category-media #toolTabs .tool-tab {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui-theme="saas"] #mainTabs .main-tab,
  html[data-ui-theme="saas"] #toolTabs .tool-tab {
    transition: none !important;
  }
}

/* Retro refresh — compact Windows XP utility window with modern layout discipline. */
html[data-ui-theme="xp"] .header {
  padding: 7px 10px 4px !important;
}

html[data-ui-theme="xp"] .header-top {
  min-height: 36px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

html[data-ui-theme="xp"] .wrap {
  width: min(100%, 1060px) !important;
  max-width: 1060px !important;
  margin-inline: auto !important;
}

html[data-ui-theme="xp"] #mainContent > .card {
  padding: 0 10px 12px !important;
  border-color: #0b3c9d !important;
  border-radius: 8px 8px 4px 4px !important;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .3) !important;
}

html[data-ui-theme="xp"] .xp-window-titlebar {
  height: 31px !important;
  margin: 0 -10px 8px !important;
  padding-inline: 8px 5px !important;
}

html[data-ui-theme="xp"] .logo-wrap {
  justify-content: center !important;
  margin: 8px 8px 6px !important;
  text-align: center !important;
}

html[data-ui-theme="xp"] .logo-xp {
  width: min(260px, 76vw) !important;
  height: auto !important;
}

html[data-ui-theme="xp"] .workspace-intro {
  position: relative !important;
  display: grid !important;
  width: min(100%, 760px) !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 8px auto 10px !important;
  padding: 11px 14px 12px !important;
  clip: auto !important;
  clip-path: none !important;
  overflow: visible !important;
  border: 2px solid !important;
  border-color: #ffffff #808080 #808080 #ffffff !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #fff 0%, #f4f2e6 100%) !important;
  box-shadow: inset 1px 1px 0 #dfdfdf !important;
  text-align: center !important;
}

html[data-ui-theme="xp"] .workspace-intro .workspace-kicker {
  justify-self: center !important;
  margin-bottom: 3px !important;
  padding: 2px 7px !important;
  border: 1px solid #d88900 !important;
  border-radius: 2px !important;
  background: #fff2c7 !important;
  color: #713d00 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
}

html[data-ui-theme="xp"] .workspace-intro h1 {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  color: #0a246a !important;
  font-size: 17px !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

html[data-ui-theme="xp"] .workspace-intro p {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 640px !important;
  margin: 4px auto 0 !important;
  color: #333 !important;
  font-size: 11.5px !important;
  line-height: 1.4 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

html[data-ui-theme="xp"] #toolSearchWrap {
  width: min(100%, 620px) !important;
  margin: 8px auto 7px !important;
}

html[data-ui-theme="xp"] .privacy-status {
  width: fit-content !important;
  max-width: calc(100% - 16px) !important;
  margin: 6px auto 10px !important;
  padding: 4px 9px !important;
  border: 1px solid #aca899 !important;
  background: #ffffe1 !important;
  color: #303030 !important;
  text-align: center !important;
}

html[data-ui-theme="xp"] .nav-shell {
  display: grid !important;
  gap: 5px !important;
  width: min(100%, 980px) !important;
  margin: 0 auto 12px !important;
  padding: 7px !important;
  border: 2px solid !important;
  border-color: #ffffff #808080 #808080 #ffffff !important;
  border-radius: 0 !important;
  background: #d4d0c8 !important;
  box-shadow: inset 1px 1px 0 #dfdfdf !important;
  overflow: visible !important;
}

html[data-ui-theme="xp"] .nav-rail-label {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 19px !important;
  padding: 0 3px !important;
  color: #333 !important;
}

html[data-ui-theme="xp"] .nav-rail-label strong {
  color: #0a246a !important;
  font-size: 11px !important;
}

html[data-ui-theme="xp"] .nav-rail-label span {
  color: #555 !important;
  font-size: 10px !important;
}

html[data-ui-theme="xp"] .nav-rail-label-tools {
  margin-top: 3px !important;
  padding-top: 7px !important;
  border-top: 1px solid #aca899 !important;
}

html[data-ui-theme="xp"] #mainTabs.main-tabs {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 4px !important;
  border: 1px solid !important;
  border-color: #808080 #ffffff #ffffff #808080 !important;
  border-radius: 0 !important;
  background: #ece9d8 !important;
  overflow: visible !important;
}

html[data-ui-theme="xp"] #mainTabs .main-tab {
  display: inline-flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 45px !important;
  height: auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  margin: 0 !important;
  padding: 7px 8px !important;
  border: 2px solid !important;
  border-color: #ffffff #808080 #808080 #ffffff !important;
  border-radius: 2px !important;
  background: linear-gradient(180deg, #fff 0%, #e7e3d2 100%) !important;
  color: #102040 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  white-space: normal !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-ui-theme="xp"] #mainTabs .main-tab-icon {
  width: 17px !important;
  height: 17px !important;
  flex: 0 0 17px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  opacity: .78 !important;
}

html[data-ui-theme="xp"] #mainTabs .main-tab:hover {
  border-color: #7da2ce #31557e #31557e #7da2ce !important;
  background: #dce8f7 !important;
}

html[data-ui-theme="xp"] #mainTabs .main-tab.active {
  border-color: #596f87 #ffffff #ffffff #596f87 !important;
  background: #c7d9f2 !important;
  color: #08265d !important;
  font-weight: 700 !important;
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .12) !important;
}

html[data-ui-theme="xp"] #toolTabs.tool-tabs,
html[data-ui-theme="xp"] body.mt-category-media #toolTabs.tool-tabs {
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 4px !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 5px !important;
  border: 1px solid !important;
  border-color: #808080 #ffffff #ffffff #808080 !important;
  border-radius: 0 !important;
  background: #ece9d8 !important;
  overflow: visible !important;
}

html[data-ui-theme="xp"] #toolTabs .tool-tab,
html[data-ui-theme="xp"] body.mt-category-media #toolTabs .tool-tab {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 31px !important;
  height: auto !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 1px !important;
  background: transparent !important;
  color: #111 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  white-space: normal !important;
  box-shadow: none !important;
}

html[data-ui-theme="xp"] #toolTabs .tool-tab:hover,
html[data-ui-theme="xp"] body.mt-category-media #toolTabs .tool-tab:hover {
  border-color: #316ac5 !important;
  background: #d8e6f7 !important;
}

html[data-ui-theme="xp"] #toolTabs .tool-tab.active,
html[data-ui-theme="xp"] body.mt-category-media #toolTabs .tool-tab.active {
  border-color: #316ac5 !important;
  background: #a9c4e8 !important;
  color: #061d4d !important;
  font-weight: 700 !important;
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .18) !important;
}

html[data-ui-theme="xp"] .section.show {
  width: min(100%, 980px) !important;
  margin: 8px auto 0 !important;
  padding: 12px !important;
  border: 2px solid !important;
  border-color: #808080 #ffffff #ffffff #808080 !important;
  border-radius: 0 !important;
  background: #f7f5e9 !important;
  box-shadow: inset 1px 1px 0 #dfdfdf !important;
}

html[data-ui-theme="xp"] .section.show > .title {
  margin-top: 0 !important;
  color: #0a246a !important;
  text-align: center !important;
}

html[data-ui-theme="xp"] .section.show > .sub {
  text-align: center !important;
}

html[data-ui-theme="xp"] #mainTabs .main-tab:focus-visible,
html[data-ui-theme="xp"] #toolTabs .tool-tab:focus-visible {
  outline: 1px dotted #000 !important;
  outline-offset: -4px !important;
}

@media (max-width: 900px) {
  html[data-ui-theme="xp"] #mainTabs.main-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  html[data-ui-theme="xp"] .header {
    padding-inline: 6px !important;
  }

  html[data-ui-theme="xp"] .header-top {
    gap: 6px !important;
  }

  html[data-ui-theme="xp"] .wrap {
    padding-inline: 6px !important;
  }

  html[data-ui-theme="xp"] #mainContent > .card {
    padding: 0 6px 8px !important;
  }

  html[data-ui-theme="xp"] .xp-window-titlebar {
    margin-inline: -6px !important;
  }

  html[data-ui-theme="xp"] .workspace-intro {
    margin-top: 6px !important;
    padding: 9px 10px 10px !important;
  }

  html[data-ui-theme="xp"] .workspace-intro h1 {
    font-size: 15px !important;
  }

  html[data-ui-theme="xp"] .nav-rail-label span {
    display: none !important;
  }

  html[data-ui-theme="xp"] #mainTabs.main-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 3px !important;
  }

  html[data-ui-theme="xp"] #mainTabs .main-tab {
    min-height: 43px !important;
    padding: 7px 6px !important;
  }

  html[data-ui-theme="xp"] #toolTabs .tool-tab,
  html[data-ui-theme="xp"] body.mt-category-media #toolTabs .tool-tab {
    flex: 0 0 calc(50% - 2px) !important;
    width: calc(50% - 2px) !important;
    max-width: calc(50% - 2px) !important;
    min-height: 34px !important;
    padding: 6px !important;
  }

  html[data-ui-theme="xp"] .section.show {
    padding: 10px 8px !important;
  }
}

@media (max-width: 340px) {
  html[data-ui-theme="xp"] #toolTabs .tool-tab,
  html[data-ui-theme="xp"] body.mt-category-media #toolTabs .tool-tab {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
